Small refactor of CCoinsViewCache::BatchWrite()
Small refactor of CCoinsViewCache::BatchWrite()

std::unordered_map::erase( const_iterator pos ) returns an iterator to the element following the removed one. Use that to optimize (probably minor-performance-wise, and definitely code-structure-wise) the implementation of CCoinsViewCache::BatchWrite().

untrustbank/litecoin,droark/bitcoin,BTCGPU/BTCGPU,sebrandon1/bitcoin,apoelstra/bitcoin,ahmedbodi/vertcoin,gjhiggins/vcoincore,Christewart/bitcoin,Bushstar/UFO-Project,jonasschnelli/bitcoin,untrustbank/litecoin,cdecker/bitcoin,n1bor/bitcoin,alecalve/bitcoin,tecnovert/particl-core,tecnovert/particl-core,monacoinproject/monacoin,domob1812/bitcoin,anditto/bitcoin,Kogser/bitcoin,qtumproject/qtum,stamhe/bitcoin,namecoin/namecoin-core,1185/starwels,DigitalPandacoin/pandacoin,maaku/bitcoin,TheBlueMatt/bitcoin,RHavar/bitcoin,myriadcoin/myriadcoin,mitchellcash/bitcoin,EthanHeilman/bitcoin,ppcoin/ppcoin,starwels/starwels,mb300sd/bitcoin,ryanofsky/bitcoin,lateminer/bitcoin,cdecker/bitcoin,fanquake/bitcoin,sebrandon1/bitcoin,fanquake/bitcoin,myriadcoin/myriadcoin,kallewoof/bitcoin,apoelstra/bitcoin,rawodb/bitcoin,bitcoin/bitcoin,FeatherCoin/Feathercoin,joshrabinowitz/bitcoin,vmp32k/litecoin,monacoinproject/monacoin,anditto/bitcoin,jmcorgan/bitcoin,laudaa/bitcoin,pstratem/bitcoin,bitcoinknots/bitcoin,tjps/bitcoin,peercoin/peercoin,CryptArc/bitcoin,deeponion/deeponion,ahmedbodi/vertcoin,donaloconnor/bitcoin,particl/particl-core,instagibbs/bitcoin,sipsorcery/bitcoin,untrustbank/litecoin,particl/particl-core,Bushstar/UFO-Project,pataquets/namecoin-core,andreaskern/bitcoin,wellenreiter01/Feathercoin,maaku/bitcoin,namecoin/namecoin-core,randy-waterhouse/bitcoin,TheBlueMatt/bitcoin,viacoin/viacoin,starwels/starwels,lbryio/lbrycrd,namecoin/namecoin-core,rnicoll/bitcoin,tjps/bitcoin,peercoin/peercoin,Sjors/bitcoin,GroestlCoin/bitcoin,jmcorgan/bitcoin,brandonrobertz/namecoin-core,MeshCollider/bitcoin,Christewart/bitcoin,kallewoof/bitcoin,ElementsProject/elements,sipsorcery/bitcoin,donaloconnor/bitcoin,Xekyo/bitcoin,andreaskern/bitcoin,tjps/bitcoin,FeatherCoin/Feathercoin,mm-s/bitcoin,sstone/bitcoin,wellenreiter01/Feathercoin,litecoin-project/litecoin,AkioNak/bitcoin,particl/particl-core,droark/bitcoin,qtumproject/qtum,1185/starwels,globaltoken/globaltoken,CryptArc/bitcoin,namecoin/namecore,jamesob/bitcoin,jnewbery/bitcoin,Flowdalic/bitcoin,domob1812/huntercore,domob1812/bitcoin,instagibbs/bitcoin,particl/particl-core,kazcw/bitcoin,fujicoin/fujicoin,apoelstra/bitcoin,n1bor/bitcoin,Christewart/bitcoin,sstone/bitcoin,andreaskern/bitcoin,rnicoll/dogecoin,qtumproject/qtum,litecoin-project/litecoin,guncoin/guncoin,droark/bitcoin,dscotese/bitcoin,monacoinproject/monacoin,DigitalPandacoin/pandacoin,fujicoin/fujicoin,bitcoin/bitcoin,FeatherCoin/Feathercoin,qtumproject/qtum,pataquets/namecoin-core,bitcoinsSG/bitcoin,litecoin-project/litecoin,globaltoken/globaltoken,jambolo/bitcoin,AkioNak/bitcoin,r8921039/bitcoin,GroestlCoin/bitcoin,jmcorgan/bitcoin,deeponion/deeponion,r8921039/bitcoin,MazaCoin/maza,TheBlueMatt/bitcoin,Kogser/bitcoin,ajtowns/bitcoin,Kogser/bitcoin,fujicoin/fujicoin,Kogser/bitcoin,sstone/bitcoin,sipsorcery/bitcoin,maaku/bitcoin,jnewbery/bitcoin,kazcw/bitcoin,Rav3nPL/bitcoin,sstone/bitcoin,Flowdalic/bitcoin,n1bor/bitcoin,wellenreiter01/Feathercoin,afk11/bitcoin,mm-s/bitcoin,OmniLayer/omnicore,EthanHeilman/bitcoin,JeremyRubin/bitcoin,laudaa/bitcoin,lbryio/lbrycrd,Flowdalic/bitcoin,domob1812/bitcoin,kazcw/bitcoin,AkioNak/bitcoin,EthanHeilman/bitcoin,digibyte/digibyte,nikkitan/bitcoin,DigitalPandacoin/pandacoin,ElementsProject/elements,Bushstar/UFO-Project,Sjors/bitcoin,GroestlCoin/GroestlCoin,viacoin/viacoin,lbryio/lbrycrd,namecoin/namecore,AkioNak/bitcoin,gjhiggins/vcoincore,1185/starwels,joshrabinowitz/bitcoin,lateminer/bitcoin,jamesob/bitcoin,digibyte/digibyte,h4x3rotab/BTCGPU,donaloconnor/bitcoin,donaloconnor/bitcoin,peercoin/peercoin,CryptArc/bitcoin,tjps/bitcoin,alecalve/bitcoin,Flowdalic/bitcoin,jnewbery/bitcoin,OmniLayer/omnicore,vmp32k/litecoin,anditto/bitcoin,instagibbs/bitcoin,GroestlCoin/bitcoin,Xekyo/bitcoin,vmp32k/litecoin,rnicoll/dogecoin,bitcoinsSG/bitcoin,joshrabinowitz/bitcoin,dscotese/bitcoin,starwels/starwels,achow101/bitcoin,bitcoinsSG/bitcoin,jnewbery/bitcoin,lateminer/bitcoin,Xekyo/bitcoin,gjhiggins/vcoincore,gjhiggins/vcoincore,vertcoin/vertcoin,RHavar/bitcoin,domob1812/huntercore,fanquake/bitcoin,h4x3rotab/BTCGPU,ahmedbodi/vertcoin,myriadteam/myriadcoin,andreaskern/bitcoin,Kogser/bitcoin,tjps/bitcoin,jambolo/bitcoin,myriadteam/myriadcoin,afk11/bitcoin,MazaCoin/maza,digibyte/digibyte,ajtowns/bitcoin,ericshawlinux/bitcoin,rawodb/bitcoin,bespike/litecoin,yenliangl/bitcoin,myriadcoin/myriadcoin,afk11/bitcoin,alecalve/bitcoin,TheBlueMatt/bitcoin,GroestlCoin/GroestlCoin,jambolo/bitcoin,prusnak/bitcoin,domob1812/huntercore,jonasschnelli/bitcoin,domob1812/huntercore,r8921039/bitcoin,laudaa/bitcoin,prusnak/bitcoin,ericshawlinux/bitcoin,JeremyRubin/bitcoin,stamhe/bitcoin,ericshawlinux/bitcoin,stamhe/bitcoin,rnicoll/dogecoin,maaku/bitcoin,bitcoin/bitcoin,RHavar/bitcoin,jamesob/bitcoin,ppcoin/ppcoin,afk11/bitcoin,DigitalPandacoin/pandacoin,tecnovert/particl-core,kazcw/bitcoin,instagibbs/bitcoin,ericshawlinux/bitcoin,TheBlueMatt/bitcoin,Kogser/bitcoin,domob1812/bitcoin,prusnak/bitcoin,Xekyo/bitcoin,ElementsProject/elements,1185/starwels,myriadcoin/myriadcoin,guncoin/guncoin,Kogser/bitcoin,qtumproject/qtum,tjps/bitcoin,bitcoinsSG/bitcoin,alecalve/bitcoin,namecoin/namecoin-core,monacoinproject/monacoin,wellenreiter01/Feathercoin,1185/starwels,Flowdalic/bitcoin,afk11/bitcoin,peercoin/peercoin,midnightmagic/bitcoin,domob1812/huntercore,MeshCollider/bitcoin,lateminer/bitcoin,BTCGPU/BTCGPU,kallewoof/bitcoin,sipsorcery/bitcoin,bitcoinknots/bitcoin,ericshawlinux/bitcoin,lbryio/lbrycrd,sebrandon1/bitcoin,sebrandon1/bitcoin,wellenreiter01/Feathercoin,namecoin/namecoin-core,ryanofsky/bitcoin,myriadcoin/myriadcoin,fanquake/bitcoin,rnicoll/dogecoin,nikkitan/bitcoin,GroestlCoin/GroestlCoin,droark/bitcoin,donaloconnor/bitcoin,digibyte/digibyte,h4x3rotab/BTCGPU,Christewart/bitcoin,cdecker/bitcoin,instagibbs/bitcoin,jlopp/statoshi,JeremyRubin/bitcoin,mm-s/bitcoin,yenliangl/bitcoin,kallewoof/bitcoin,viacoin/viacoin,bitcoinknots/bitcoin,jamesob/bitcoin,domob1812/bitcoin,r8921039/bitcoin,GlobalBoost/GlobalBoost,pataquets/namecoin-core,mb300sd/bitcoin,jlopp/statoshi,andreaskern/bitcoin,particl/particl-core,stamhe/bitcoin,mb300sd/bitcoin,GlobalBoost/GlobalBoost,GroestlCoin/bitcoin,n1bor/bitcoin,lbryio/lbrycrd,nikkitan/bitcoin,mb300sd/bitcoin,brandonrobertz/namecoin-core,JeremyRubin/bitcoin,ElementsProject/elements,apoelstra/bitcoin,mb300sd/bitcoin,ajtowns/bitcoin,MeshCollider/bitcoin,jtimon/bitcoin,yenliangl/bitcoin,BTCGPU/BTCGPU,mruddy/bitcoin,yenliangl/bitcoin,vmp32k/litecoin,prusnak/bitcoin,MarcoFalke/bitcoin,ElementsProject/elements,untrustbank/litecoin,lbryio/lbrycrd,r8921039/bitcoin,prusnak/bitcoin,rnicoll/bitcoin,MazaCoin/maza,bespike/litecoin,yenliangl/bitcoin,jambolo/bitcoin,stamhe/bitcoin,TheBlueMatt/bitcoin,lbryio/lbrycrd,GlobalBoost/GlobalBoost,bitcoin/bitcoin,dscotese/bitcoin,brandonrobertz/namecoin-core,particl/particl-core,joshrabinowitz/bitcoin,viacoin/viacoin,jtimon/bitcoin,untrustbank/litecoin,mitchellcash/bitcoin,maaku/bitcoin,brandonrobertz/namecoin-core,globaltoken/globaltoken,achow101/bitcoin,midnightmagic/bitcoin,Kogser/bitcoin,bespike/litecoin,rnicoll/bitcoin,sipsorcery/bitcoin,Rav3nPL/bitcoin,thrasher-/litecoin,randy-waterhouse/bitcoin,andreaskern/bitcoin,namecoin/namecore,digibyte/digibyte,kallewoof/bitcoin,cdecker/bitcoin,mm-s/bitcoin,jmcorgan/bitcoin,rawodb/bitcoin,afk11/bitcoin,rnicoll/dogecoin,MarcoFalke/bitcoin,GlobalBoost/GlobalBoost,CryptArc/bitcoin,bespike/litecoin,jambolo/bitcoin,BTCGPU/BTCGPU,bitcoinknots/bitcoin,laudaa/bitcoin,paveljanik/bitcoin,ericshawlinux/bitcoin,joshrabinowitz/bitcoin,pstratem/bitcoin,practicalswift/bitcoin,jtimon/bitcoin,bitcoin/bitcoin,mruddy/bitcoin,r8921039/bitcoin,tecnovert/particl-core,pstratem/bitcoin,OmniLayer/omnicore,dscotese/bitcoin,mb300sd/bitcoin,instagibbs/bitcoin,GlobalBoost/GlobalBoost,ryanofsky/bitcoin,mm-s/bitcoin,practicalswift/bitcoin,lateminer/bitcoin,mitchellcash/bitcoin,sstone/bitcoin,peercoin/peercoin,dscotese/bitcoin,DigitalPandacoin/pandacoin,monacoinproject/monacoin,AkioNak/bitcoin,apoelstra/bitcoin,ahmedbodi/vertcoin,ryanofsky/bitcoin,n1bor/bitcoin,midnightmagic/bitcoin,mruddy/bitcoin,myriadteam/myriadcoin,kazcw/bitcoin,practicalswift/bitcoin,myriadteam/myriadcoin,randy-waterhouse/bitcoin,domob1812/namecore,paveljanik/bitcoin,anditto/bitcoin,kazcw/bitcoin,JeremyRubin/bitcoin,pstratem/bitcoin,globaltoken/globaltoken,prusnak/bitcoin,Kogser/bitcoin,AkioNak/bitcoin,bespike/litecoin,monacoinproject/monacoin,practicalswift/bitcoin,deeponion/deeponion,GroestlCoin/bitcoin,jonasschnelli/bitcoin,Bushstar/UFO-Project,MarcoFalke/bitcoin,brandonrobertz/namecoin-core,paveljanik/bitcoin,jlopp/statoshi,laudaa/bitcoin,mruddy/bitcoin,EthanHeilman/bitcoin,Rav3nPL/bitcoin,starwels/starwels,domob1812/namecore,apoelstra/bitcoin,jtimon/bitcoin,digibyte/digibyte,jmcorgan/bitcoin,myriadcoin/myriadcoin,Christewart/bitcoin,fanquake/bitcoin,mruddy/bitcoin,thrasher-/litecoin,ppcoin/ppcoin,sipsorcery/bitcoin,alecalve/bitcoin,jtimon/bitcoin,h4x3rotab/BTCGPU,GroestlCoin/GroestlCoin,CryptArc/bitcoin,Kogser/bitcoin,ajtowns/bitcoin,lateminer/bitcoin,Rav3nPL/bitcoin,Xekyo/bitcoin,achow101/bitcoin,Kogser/bitcoin,droark/bitcoin,CryptArc/bitcoin,rawodb/bitcoin,cdecker/bitcoin,randy-waterhouse/bitcoin,jamesob/bitcoin,achow101/bitcoin,BTCGPU/BTCGPU,vertcoin/vertcoin,domob1812/namecore,sebrandon1/bitcoin,RHavar/bitcoin,vmp32k/litecoin,maaku/bitcoin,MazaCoin/maza,GroestlCoin/GroestlCoin,thrasher-/litecoin,domob1812/namecore,kallewoof/bitcoin,Sjors/bitcoin,jmcorgan/bitcoin,ajtowns/bitcoin,bitcoinsSG/bitcoin,litecoin-project/litecoin,GlobalBoost/GlobalBoost,tecnovert/particl-core,GroestlCoin/GroestlCoin,FeatherCoin/Feathercoin,viacoin/viacoin,peercoin/peercoin,litecoin-project/litecoin,FeatherCoin/Feathercoin,MeshCollider/bitcoin,OmniLayer/omnicore,brandonrobertz/namecoin-core,paveljanik/bitcoin,pstratem/bitcoin,thrasher-/litecoin,domob1812/bitcoin,gjhiggins/vcoincore,joshrabinowitz/bitcoin,GroestlCoin/bitcoin,guncoin/guncoin,donaloconnor/bitcoin,ElementsProject/elements,vertcoin/vertcoin,Sjors/bitcoin,EthanHeilman/bitcoin,bitcoinsSG/bitcoin,jlopp/statoshi,droark/bitcoin,Sjors/bitcoin,BTCGPU/BTCGPU,jonasschnelli/bitcoin,jnewbery/bitcoin,vertcoin/vertcoin,MarcoFalke/bitcoin,MeshCollider/bitcoin,guncoin/guncoin,randy-waterhouse/bitcoin,nikkitan/bitcoin,myriadteam/myriadcoin,deeponion/deeponion,Bushstar/UFO-Project,pstratem/bitcoin,rnicoll/bitcoin,domob1812/namecore,jamesob/bitcoin,nikkitan/bitcoin,ryanofsky/bitcoin,deeponion/deeponion,mitchellcash/bitcoin,midnightmagic/bitcoin,JeremyRubin/bitcoin,tecnovert/particl-core,deeponion/deeponion,EthanHeilman/bitcoin,randy-waterhouse/bitcoin,vertcoin/vertcoin,n1bor/bitcoin,starwels/starwels,viacoin/viacoin,guncoin/guncoin,pataquets/namecoin-core,rnicoll/bitcoin,achow101/bitcoin,starwels/starwels,1185/starwels,namecoin/namecore,Rav3nPL/bitcoin,pataquets/namecoin-core,achow101/bitcoin,domob1812/huntercore,jlopp/statoshi,MazaCoin/maza,untrustbank/litecoin,paveljanik/bitcoin,FeatherCoin/Feathercoin,fanquake/bitcoin,laudaa/bitcoin,namecoin/namecore,thrasher-/litecoin,qtumproject/qtum,gjhiggins/vcoincore,vmp32k/litecoin,fujicoin/fujicoin,namecoin/namecoin-core,Rav3nPL/bitcoin,Xekyo/bitcoin,anditto/bitcoin,h4x3rotab/BTCGPU,mitchellcash/bitcoin,MarcoFalke/bitcoin,practicalswift/bitcoin,jlopp/statoshi,midnightmagic/bitcoin,mm-s/bitcoin,dscotese/bitcoin,Christewart/bitcoin,litecoin-project/litecoin,vertcoin/vertcoin,midnightmagic/bitcoin,sstone/bitcoin,myriadteam/myriadcoin,Bushstar/UFO-Project,ryanofsky/bitcoin,domob1812/namecore,h4x3rotab/BTCGPU,DigitalPandacoin/pandacoin,nikkitan/bitcoin,jonasschnelli/bitcoin,thrasher-/litecoin,anditto/bitcoin,paveljanik/bitcoin,RHavar/bitcoin,OmniLayer/omnicore,namecoin/namecore,ahmedbodi/vertcoin,fujicoin/fujicoin,ajtowns/bitcoin,cdecker/bitcoin,wellenreiter01/Feathercoin,MarcoFalke/bitcoin,sebrandon1/bitcoin,globaltoken/globaltoken,rawodb/bitcoin,fujicoin/fujicoin,rawodb/bitcoin,bitcoinknots/bitcoin,GlobalBoost/GlobalBoost,RHavar/bitcoin,ppcoin/ppcoin,jambolo/bitcoin,MazaCoin/maza,practicalswift/bitcoin,ahmedbodi/vertcoin,mruddy/bitcoin,globaltoken/globaltoken,Kogser/bitcoin,guncoin/guncoin,mitchellcash/bitcoin,bespike/litecoin,stamhe/bitcoin,jtimon/bitcoin,OmniLayer/omnicore,yenliangl/bitcoin,MeshCollider/bitcoin,pataquets/namecoin-core,bitcoin/bitcoin,rnicoll/bitcoin,qtumproject/qtum,Flowdalic/bitcoin,alecalve/bitcoin