Avoid crash on start in TestBlockValidity with gen=1.
Avoid crash on start in TestBlockValidity with gen=1.

When the internal miner is enabled at the start of a new node, there
 is an near instant assert in TestBlockValidity because its attempting
 to mine a block before the top checkpoint.

Also avoids a data race around vNodes.

Github-Pull: #6123
Rebased-From: bba7c249296a9a2f444e1035fef8f8b593ba2aaf

dashpay/dash,coinkeeper/2015-06-22_18-52_viacoin,mycointest/owncoin,kleetus/bitcoinxt,puticcoin/putic,alejandromgk/Lunar,cerebrus29301/crowncoin,Mrs-X/Darknet,genavarov/ladacoin,freelion93/mtucicoin,dashpay/dash,slingcoin/sling-market,axelxod/braincoin,fullcoins/fullcoin,Bloom-Project/Bloom,freelion93/mtucicoin,thelazier/dash,gwillen/elements,willwray/dash,UdjinM6/dash,mapineda/litecoin,Mrs-X/PIVX,Petr-Economissa/gvidon,capitalDIGI/DIGI-v-0-10-4,UdjinM6/dash,PIVX-Project/PIVX,sipa/elements,pstratem/elements,alejandromgk/Lunar,biblepay/biblepay,benzmuircroft/REWIRE.io,mikehearn/bitcoinxt,ptschip/bitcoinxt,aspirecoin/aspire,Mrs-X/PIVX,DynamicCoinOrg/DMC,ahmedbodi/test2,Electronic-Gulden-Foundation/egulden,mockcoin/mockcoin,inkvisit/sarmacoins,slingcoin/sling-market,rdqw/sscoin,mikehearn/bitcoinxt,Rav3nPL/doubloons-0.10,Mrs-X/PIVX,ivansib/sibcoin,antcheck/antcoin,coinkeeper/2015-06-22_18-52_viacoin,my-first/octocoin,fullcoins/fullcoin,upgradeadvice/MUE-Src,jmgilbert2/energi,sipa/elements,Darknet-Crypto/Darknet,apoelstra/elements,antcheck/antcoin,benzmuircroft/REWIRE.io,schinzelh/dash,KibiCoin/kibicoin,schinzelh/dash,HeliumGas/helium,jmgilbert2/energi,keesdewit82/LasVegasCoin,Vsync-project/Vsync,kleetus/bitcoinxt,cerebrus29301/crowncoin,ticclassic/ic,sipa/elements,capitalDIGI/DIGI-v-0-10-4,worldbit/worldbit,LIMXTEC/DMDv3,ionomy/ion,lakepay/lake,capitalDIGI/DIGI-v-0-10-4,CoinProjects/AmsterdamCoin-v4,KibiCoin/kibicoin,Bloom-Project/Bloom,terracoin/terracoin,PandaPayProject/PandaPay,my-first/octocoin,MazaCoin/mazacoin-new,apoelstra/elements,OstlerDev/florincoin,tropa/axecoin,cerebrus29301/crowncoin,MonetaryUnit/MUE-Src,CoinProjects/AmsterdamCoin-v4,droark/elements,Bloom-Project/Bloom,puticcoin/putic,ingresscoin/ingresscoin,freelion93/mtucicoin,HeliumGas/helium,fullcoins/fullcoin,ticclassic/ic,pelorusjack/BlockDX,keesdewit82/LasVegasCoin,florincoin/florincoin,GwangJin/gwangmoney-core,lakepay/lake,pinkevich/dash,mapineda/litecoin,Darknet-Crypto/Darknet,terracoin/terracoin,koharjidan/litecoin,MonetaryUnit/MUE-Src,capitalDIGI/litecoin,keesdewit82/LasVegasCoin,pelorusjack/BlockDX,npccoin/npccoin,DMDcoin/Diamond,fussl/elements,diggcoin/diggcoin,dmrtsvetkov/flowercoin,fussl/elements,Kenwhite23/litecoin,lakepay/lake,Electronic-Gulden-Foundation/egulden,presstab/PIVX,nmarley/dash,Darknet-Crypto/Darknet,Darknet-Crypto/Darknet,dmrtsvetkov/flowercoin,CoinProjects/AmsterdamCoin-v4,pstratem/elements,PIVX-Project/PIVX,diggcoin/diggcoin,genavarov/brcoin,Bloom-Project/Bloom,projectinterzone/ITZ,pinkevich/dash,alejandromgk/Lunar,genavarov/brcoin,upgradeadvice/MUE-Src,OmniLayer/omnicore,cerebrus29301/crowncoin,crowning-/dash,Rav3nPL/doubloons-0.10,axelxod/braincoin,apoelstra/elements,Electronic-Gulden-Foundation/egulden,NunoEdgarGub1/elements,MazaCoin/maza,Bloom-Project/Bloom,mapineda/litecoin,RyanLucchese/energi,Kenwhite23/litecoin,OstlerDev/florincoin,truthcoin/blocksize-market,genavarov/ladacoin,zottejos/merelcoin,Petr-Economissa/gvidon,ahmedbodi/test2,ptschip/bitcoinxt,mapineda/litecoin,OstlerDev/florincoin,ingresscoin/ingresscoin,alejandromgk/Lunar,rdqw/sscoin,Petr-Economissa/gvidon,tropa/axecoin,pstratem/elements,alejandromgk/Lunar,Mrs-X/PIVX,PIVX-Project/PIVX,willwray/dash,putinclassic/putic,pascalguru/florincoin,npccoin/npccoin,grumpydevelop/singularity,dev1972/Satellitecoin,rsdevgun16e/energi,nmarley/dash,HeliumGas/helium,lakepay/lake,nmarley/dash,zottejos/merelcoin,ArgonToken/ArgonToken,apoelstra/elements,jtimon/elements,lakepay/lake,worldbit/worldbit,pinkevich/dash,OmniLayer/omnicore,presstab/PIVX,mycointest/owncoin,mapineda/litecoin,ivansib/sib16,pstratem/elements,worldbit/worldbit,48thct2jtnf/P,GwangJin/gwangmoney-core,kleetus/bitcoinxt,ivansib/sib16,ediston/energi,ivansib/sib16,inkvisit/sarmacoins,pelorusjack/BlockDX,puticcoin/putic,PIVX-Project/PIVX,ColossusCoinXT/ColossusCoinXT,putinclassic/putic,ticclassic/ic,ingresscoin/ingresscoin,MonetaryUnit/MUE-Src,genavarov/ladacoin,LIMXTEC/DMDv3,worldbit/worldbit,rsdevgun16e/energi,Electronic-Gulden-Foundation/egulden,alejandromgk/Lunar,Rav3nPL/doubloons-0.10,capitalDIGI/DIGI-v-0-10-4,jtimon/elements,GwangJin/gwangmoney-core,DMDcoin/Diamond,puticcoin/putic,crowning-/dash,BlockchainTechLLC/3dcoin,Mrs-X/PIVX,sipa/elements,ptschip/bitcoinxt,mockcoin/mockcoin,capitalDIGI/litecoin,ahmedbodi/test2,npccoin/npccoin,terracoin/terracoin,48thct2jtnf/P,DynamicCoinOrg/DMC,mikehearn/bitcoinxt,droark/elements,capitalDIGI/litecoin,ivansib/sib16,octocoin-project/octocoin,OmniLayer/omnicore,zottejos/merelcoin,biblepay/biblepay,ingresscoin/ingresscoin,ingresscoin/ingresscoin,MazaCoin/mazacoin-new,joulecoin/joulecoin,ediston/energi,putinclassic/putic,UdjinM6/dash,ivansib/sibcoin,genavarov/brcoin,ivansib/sibcoin,Kenwhite23/litecoin,worldbit/worldbit,PandaPayProject/PandaPay,apoelstra/elements,axelxod/braincoin,thelazier/dash,presstab/PIVX,dev1972/Satellitecoin,jtimon/elements,DMDcoin/Diamond,ahmedbodi/test2,diggcoin/diggcoin,nmarley/dash,putinclassic/putic,48thct2jtnf/P,kleetus/bitcoinxt,coinkeeper/2015-06-22_18-52_viacoin,RibbitFROG/ribbitcoin,MazaCoin/maza,DynamicCoinOrg/DMC,aburan28/elements,gwillen/elements,DynamicCoinOrg/DMC,capitalDIGI/litecoin,puticcoin/putic,florincoin/florincoin,ticclassic/ic,fullcoins/fullcoin,Petr-Economissa/gvidon,sipa/elements,antcheck/antcoin,KibiCoin/kibicoin,OmniLayer/omnicore,NunoEdgarGub1/elements,dev1972/Satellitecoin,capitalDIGI/litecoin,keesdewit82/LasVegasCoin,MazaCoin/mazacoin-new,MazaCoin/maza,slingcoin/sling-market,biblepay/biblepay,crowning-/dash,MonetaryUnit/MUE-Src,pelorusjack/BlockDX,rsdevgun16e/energi,ArgonToken/ArgonToken,npccoin/npccoin,sipa/elements,aspirecoin/aspire,projectinterzone/ITZ,mikehearn/bitcoinxt,keesdewit82/LasVegasCoin,dmrtsvetkov/flowercoin,BlockchainTechLLC/3dcoin,Petr-Economissa/gvidon,biblepay/biblepay,koharjidan/litecoin,KibiCoin/kibicoin,coinkeeper/2015-06-22_18-52_viacoin,HeliumGas/helium,antcheck/antcoin,my-first/octocoin,dashpay/dash,presstab/PIVX,PIVX-Project/PIVX,midnight-miner/LasVegasCoin,ahmedbodi/test2,MazaCoin/maza,rdqw/sscoin,Electronic-Gulden-Foundation/egulden,schinzelh/dash,Mrs-X/Darknet,OstlerDev/florincoin,ivansib/sib16,dashpay/dash,truthcoin/blocksize-market,ivansib/sibcoin,thelazier/dash,joulecoin/joulecoin,aburan28/elements,aburan28/elements,pstratem/elements,MazaCoin/mazacoin-new,genavarov/lamacoin,zottejos/merelcoin,terracoin/terracoin,NunoEdgarGub1/elements,nmarley/dash,BlockchainTechLLC/3dcoin,schinzelh/dash,joulecoin/joulecoin,MonetaryUnit/MUE-Src,capitalDIGI/litecoin,presstab/PIVX,LIMXTEC/DMDv3,ArgonToken/ArgonToken,MonetaryUnit/MUE-Src,ediston/energi,jtimon/elements,RyanLucchese/energi,ticclassic/ic,midnight-miner/LasVegasCoin,PandaPayProject/PandaPay,presstab/PIVX,antcheck/antcoin,dev1972/Satellitecoin,nmarley/dash,octocoin-project/octocoin,GwangJin/gwangmoney-core,Petr-Economissa/gvidon,pinkevich/dash,jtimon/elements,diggcoin/diggcoin,UdjinM6/dash,benzmuircroft/REWIRE.io,midnight-miner/LasVegasCoin,RibbitFROG/ribbitcoin,NunoEdgarGub1/elements,Mrs-X/Darknet,48thct2jtnf/P,dmrtsvetkov/flowercoin,schinzelh/dash,ArgonToken/ArgonToken,pinkevich/dash,my-first/octocoin,fussl/elements,upgradeadvice/MUE-Src,Vsync-project/Vsync,RibbitFROG/ribbitcoin,rdqw/sscoin,truthcoin/blocksize-market,BlockchainTechLLC/3dcoin,48thct2jtnf/P,diggcoin/diggcoin,DynamicCoinOrg/DMC,crowning-/dash,biblepay/biblepay,florincoin/florincoin,Bloom-Project/Bloom,xuyangcn/opalcoin,inkvisit/sarmacoins,grumpydevelop/singularity,grumpydevelop/singularity,pascalguru/florincoin,genavarov/lamacoin,lakepay/lake,droark/elements,pinkevich/dash,KibiCoin/kibicoin,mockcoin/mockcoin,MazaCoin/maza,ArgonToken/ArgonToken,OstlerDev/florincoin,mapineda/litecoin,BlockchainTechLLC/3dcoin,RibbitFROG/ribbitcoin,keesdewit82/LasVegasCoin,DMDcoin/Diamond,48thct2jtnf/P,npccoin/npccoin,droark/elements,koharjidan/litecoin,octocoin-project/octocoin,crowning-/dash,rsdevgun16e/energi,PIVX-Project/PIVX,jmgilbert2/energi,my-first/octocoin,mycointest/owncoin,aspirecoin/aspire,biblepay/biblepay,UdjinM6/dash,crowning-/dash,NunoEdgarGub1/elements,KibiCoin/kibicoin,puticcoin/putic,ArgonToken/ArgonToken,HeliumGas/helium,ptschip/bitcoinxt,ivansib/sibcoin,joulecoin/joulecoin,biblepay/biblepay,PandaPayProject/PandaPay,my-first/octocoin,fullcoins/fullcoin,florincoin/florincoin,mycointest/owncoin,ColossusCoinXT/ColossusCoinXT,Vsync-project/Vsync,genavarov/brcoin,genavarov/lamacoin,ColossusCoinXT/ColossusCoinXT,LIMXTEC/DMDv3,tropa/axecoin,slingcoin/sling-market,genavarov/lamacoin,florincoin/florincoin,inkvisit/sarmacoins,ediston/energi,Rav3nPL/doubloons-0.10,jmgilbert2/energi,CoinProjects/AmsterdamCoin-v4,tropa/axecoin,mycointest/owncoin,genavarov/ladacoin,koharjidan/litecoin,droark/elements,coinkeeper/2015-06-22_18-52_viacoin,Kenwhite23/litecoin,kleetus/bitcoinxt,PIVX-Project/PIVX,RyanLucchese/energi,florincoin/florincoin,Vsync-project/Vsync,midnight-miner/LasVegasCoin,CoinProjects/AmsterdamCoin-v4,grumpydevelop/singularity,pelorusjack/BlockDX,projectinterzone/ITZ,inkvisit/sarmacoins,octocoin-project/octocoin,fullcoins/fullcoin,RyanLucchese/energi,capitalDIGI/DIGI-v-0-10-4,Electronic-Gulden-Foundation/egulden,Darknet-Crypto/Darknet,gwillen/elements,Mrs-X/Darknet,joulecoin/joulecoin,MazaCoin/maza,DMDcoin/Diamond,upgradeadvice/MUE-Src,ptschip/bitcoinxt,slingcoin/sling-market,genavarov/brcoin,coinkeeper/2015-06-22_18-52_viacoin,pstratem/elements,mockcoin/mockcoin,freelion93/mtucicoin,MazaCoin/mazacoin-new,willwray/dash,LIMXTEC/DMDv3,joulecoin/joulecoin,ahmedbodi/test2,projectinterzone/ITZ,ivansib/sib16,droark/elements,upgradeadvice/MUE-Src,OmniLayer/omnicore,rdqw/sscoin,schinzelh/dash,Vsync-project/Vsync,NunoEdgarGub1/elements,Rav3nPL/doubloons-0.10,putinclassic/putic,midnight-miner/LasVegasCoin,DMDcoin/Diamond,benzmuircroft/REWIRE.io,truthcoin/blocksize-market,truthcoin/blocksize-market,gwillen/elements,ionomy/ion,LIMXTEC/DMDv3,ingresscoin/ingresscoin,cerebrus29301/crowncoin,terracoin/terracoin,capitalDIGI/DIGI-v-0-10-4,dashpay/dash,worldbit/worldbit,freelion93/mtucicoin,diggcoin/diggcoin,slingcoin/sling-market,HeliumGas/helium,dev1972/Satellitecoin,pascalguru/florincoin,ptschip/bitcoinxt,rsdevgun16e/energi,RyanLucchese/energi,cerebrus29301/crowncoin,inkvisit/sarmacoins,gwillen/elements,Kenwhite23/litecoin,fussl/elements,mikehearn/bitcoinxt,mycointest/owncoin,PandaPayProject/PandaPay,apoelstra/elements,pelorusjack/BlockDX,ionomy/ion,dmrtsvetkov/flowercoin,ionomy/ion,xuyangcn/opalcoin,OstlerDev/florincoin,aspirecoin/aspire,grumpydevelop/singularity,genavarov/brcoin,biblepay/biblepay,zottejos/merelcoin,ticclassic/ic,aspirecoin/aspire,tropa/axecoin,axelxod/braincoin,PIVX-Project/PIVX,xuyangcn/opalcoin,jtimon/elements,ColossusCoinXT/ColossusCoinXT,ivansib/sibcoin,tropa/axecoin,fussl/elements,ColossusCoinXT/ColossusCoinXT,benzmuircroft/REWIRE.io,willwray/dash,thelazier/dash,jmgilbert2/energi,BlockchainTechLLC/3dcoin,mockcoin/mockcoin,rsdevgun16e/energi,upgradeadvice/MUE-Src,kleetus/bitcoinxt,gwillen/elements,xuyangcn/opalcoin,Mrs-X/Darknet,octocoin-project/octocoin,PandaPayProject/PandaPay,zottejos/merelcoin,antcheck/antcoin,dmrtsvetkov/flowercoin,pascalguru/florincoin,ediston/energi,pascalguru/florincoin,koharjidan/litecoin,genavarov/lamacoin,rdqw/sscoin,thelazier/dash,xuyangcn/opalcoin,dev1972/Satellitecoin,Darknet-Crypto/Darknet,fussl/elements,genavarov/lamacoin,axelxod/braincoin,Mrs-X/Darknet,terracoin/terracoin,jmgilbert2/energi,octocoin-project/octocoin,DynamicCoinOrg/DMC,aburan28/elements,projectinterzone/ITZ,CoinProjects/AmsterdamCoin-v4,RibbitFROG/ribbitcoin,freelion93/mtucicoin,PIVX-Project/PIVX,Kenwhite23/litecoin,RyanLucchese/energi,pascalguru/florincoin,Mrs-X/PIVX,aburan28/elements,genavarov/ladacoin,Vsync-project/Vsync,ionomy/ion,koharjidan/litecoin,ionomy/ion,willwray/dash,benzmuircroft/REWIRE.io,truthcoin/blocksize-market,ediston/energi,OmniLayer/omnicore,nmarley/dash,grumpydevelop/singularity,MazaCoin/mazacoin-new,axelxod/braincoin,genavarov/ladacoin,midnight-miner/LasVegasCoin,ColossusCoinXT/ColossusCoinXT,mockcoin/mockcoin,xuyangcn/opalcoin,npccoin/npccoin,Rav3nPL/doubloons-0.10,willwray/dash,mikehearn/bitcoinxt,RibbitFROG/ribbitcoin,aburan28/elements,putinclassic/putic,aspirecoin/aspire