Longer term workaround for chainstate corruption from negative versions.
Longer term workaround for chainstate corruption from negative versions.

This also makes negative transaction versions non-standard.

This avoids an issue triggered in Bitcoin block 256818 where transactions with
negative version numbers were incorrectly serialized into the UTXO set.

On restart nodes detect the inconsistency and refuse to start so long as
a block with these transactions is inside the self-consistency check
window, logging "coin database inconsistencies found". The software
recommends reindexing, but reindexing does not correct the problem.

This should be fixed by changing the chainstate serialization, but
working around it seems harmless for now because the version is not
used by any network rule currently.

A patch free workaround is to start with -checklevel=2 which skips
the consistency checks, but the IsStandard change is important for
miners in order to protect unpatched nodes.

Coinfigli/coinfigli,brightcoin/brightcoin,novaexchange/EAC,ccoin-project/ccoin,ronpaulcoin/ronpaulcoin,novaexchange/EAC,ohac/sakuracoin,jiffe/cosinecoin,coinkeeper/2015-04-19_21-20_litecoindark,shapiroisme/datadollar,Tetcoin/tetcoin,Czarcoin/czarcoin,mrtexaznl/mediterraneancoin,vertcoin/eyeglass,ANCompany/birdcoin-dev,oklink-dev/litecoin_block,netswift/vertcoin,shapiroisme/datadollar,Anoncoin/anoncoin,Cancercoin/Cancercoin,Litecoindark/LTCD,Rav3nPL/doubloons-08,degenorate/Deftcoin,Coinfigli/coinfigli,cinnamoncoin/Feathercoin,bootycoin-project/bootycoin,koharjidan/litecoin,scamcoinz/scamcoin,gwangjin2/gwangcoin-core,netswift/vertcoin,WorldcoinGlobal/WorldcoinLegacy,Czarcoin/czarcoin,franko-org/franko,razor-coin/razor,gwangjin2/gwangcoin-core,cryptcoins/cryptcoin,bitgoldcoin-project/bitgoldcoin,alexandrcoin/vertcoin,CrimeaCoin/crimeacoin,franko-org/franko,zzkt/solarcoin,greencoin-dev/greencoin-dev,Coinfigli/coinfigli,qreatora/worldcoin-v0.8,cryptcoins/cryptcoin,KaSt/equikoin,zemrys/vertcoin,plankton12345/litecoin,KaSt/equikoin,Tetcoin/tetcoin,richo/dongcoin,vertcoin/eyeglass,netswift/vertcoin,mrtexaznl/mediterraneancoin,WorldcoinGlobal/WorldcoinLegacy,coinkeeper/2015-06-22_18-51_vertcoin,oklink-dev/litecoin_block,vertcoin/eyeglass,coinkeeper/2015-06-22_19-19_worldcoin,coinkeeper/2015-06-22_18-30_anoncoin,coinkeeper/2015-06-22_19-19_worldcoin,ronpaulcoin/ronpaulcoin,shurcoin/shurcoin,stamhe/litecoin,ANCompany/birdcoin-dev,cqtenq/Feathercoin,cinnamoncoin/Feathercoin,franko-org/franko,greencoin-dev/greencoin-dev,Bluejudy/worldcoin,zemrys/vertcoin,koharjidan/litecoin,Bluejudy/worldcoin,Dajackal/Ronpaulcoin,Anoncoin/anoncoin,IlfirinIlfirin/shavercoin,enlighter/Feathercoin,okinc/litecoin,franko-org/franko,coinkeeper/2015-06-22_19-13_florincoin,coinkeeper/2015-04-19_21-20_litecoindark,mooncoin-project/mooncoin-landann,novaexchange/EAC,nanocoins/mycoin,mrtexaznl/mediterraneancoin,IlfirinIlfirin/shavercoin,plankton12345/litecoin,gwangjin2/gwangcoin-core,brishtiteveja/sherlockholmescoin,tensaix2j/bananacoin,scamcoinz/scamcoin,DrCrypto/darkcoin,brishtiteveja/sherlockholmescoin,dakk/soundcoin,coinkeeper/2015-06-22_18-51_vertcoin,kryptokredyt/ProjektZespolowyCoin,cqtenq/Feathercoin,coinkeeper/2015-06-22_18-46_razor,earthcoinproject/earthcoin,WorldcoinGlobal/WorldcoinLegacy,kryptokredyt/ProjektZespolowyCoin,qreatora/worldcoin-v0.8,shapiroisme/datadollar,coinkeeper/2015-06-22_18-30_anoncoin,enlighter/Feathercoin,zzkt/solarcoin,micryon/GPUcoin,Cancercoin/Cancercoin,icook/vertcoin,coinkeeper/anoncoin_20150330_fixes,KaSt/equikoin,coinkeeper/2015-06-22_19-19_worldcoin,bitgoldcoin-project/bitgoldcoin,ronpaulcoin/ronpaulcoin,privatecoin/privatecoin,oklink-dev/litecoin_block,zemrys/vertcoin,privatecoin/privatecoin,cqtenq/Feathercoin,mooncoin-project/mooncoin-landann,micryon/GPUcoin,saydulk/Feathercoin,novaexchange/EAC,coinkeeper/2015-06-22_19-13_florincoin,tensaix2j/bananacoin,enlighter/Feathercoin,coinkeeper/2015-06-22_18-51_vertcoin,Electronic-Gulden-Foundation/egulden,jiffe/cosinecoin,qreatora/worldcoin-v0.8,tensaix2j/bananacoin,nanocoins/mycoin,coinkeeper/2015-06-22_18-46_razor,cryptcoins/cryptcoin,ohac/sha1coin,Bluejudy/worldcoin,razor-coin/razor,dakk/soundcoin,ANCompany/birdcoin-dev,shurcoin/shurcoin,ghostlander/Feathercoin,Anoncoin/anoncoin,IlfirinCano/shavercoin,coinkeeper/2015-06-22_19-13_florincoin,worldcoinproject/worldcoin-v0.8,bootycoin-project/bootycoin,coinkeeper/2015-06-22_18-46_razor,neutrinofoundation/neutrino-digital-currency,netswift/vertcoin,shapiroisme/datadollar,dakk/soundcoin,richo/dongcoin,privatecoin/privatecoin,brightcoin/brightcoin,ohac/sakuracoin,Litecoindark/LTCD,KaSt/equikoin,enlighter/Feathercoin,okinc/litecoin,cinnamoncoin/Feathercoin,earthcoinproject/earthcoin,cryptcoins/cryptcoin,chrisfranko/aiden,coinkeeper/anoncoin_20150330_fixes,Czarcoin/czarcoin,DrCrypto/darkcoin,degenorate/Deftcoin,shurcoin/shurcoin,marscoin/marscoin,mooncoin-project/mooncoin-landann,wekuiz/wekoin,Dajackal/Ronpaulcoin,ohac/sha1coin,marscoin/marscoin,richo/dongcoin,WorldcoinGlobal/WorldcoinLegacy,united-scrypt-coin-project/unitedscryptcoin,greencoin-dev/greencoin-dev,Rav3nPL/doubloons-08,richo/dongcoin,united-scrypt-coin-project/unitedscryptcoin,alexandrcoin/vertcoin,Anoncoin/anoncoin,worldcoinproject/worldcoin-v0.8,coinkeeper/2015-06-22_18-46_razor,Rav3nPL/doubloons-08,ccoin-project/ccoin,zebrains/Blotter,coinkeeper/anoncoin_20150330_fixes,bitgoldcoin-project/bitgoldcoin,Ziftr/litecoin,brishtiteveja/sherlockholmescoin,coinkeeper/anoncoin_20150330_fixes,tensaix2j/bananacoin,Bluejudy/worldcoin,Dajackal/Ronpaulcoin,cinnamoncoin/Feathercoin,zzkt/solarcoin,plankton12345/litecoin,Electronic-Gulden-Foundation/egulden,earthcoinproject/earthcoin,CrimeaCoin/crimeacoin,coinkeeper/2015-06-22_18-51_vertcoin,stamhe/litecoin,Litecoindark/LTCD,shadowoneau/ozcoin,bootycoin-project/bootycoin,zebrains/Blotter,wekuiz/wekoin,saydulk/Feathercoin,cryptcoins/cryptcoin,earthcoinproject/earthcoin,shadowoneau/ozcoin,privatecoin/privatecoin,Checkcoin/checkcoin,razor-coin/razor,alexandrcoin/vertcoin,jiffe/cosinecoin,franko-org/franko,ghostlander/Feathercoin,saydulk/Feathercoin,nanocoins/mycoin,qreatora/worldcoin-v0.8,brightcoin/brightcoin,IlfirinIlfirin/shavercoin,ghostlander/Feathercoin,Czarcoin/czarcoin,qreatora/worldcoin-v0.8,chrisfranko/aiden,marscoin/marscoin,ANCompany/birdcoin-dev,ohac/sakuracoin,Bluejudy/worldcoin,zzkt/solarcoin,micryon/GPUcoin,scamcoinz/scamcoin,bitgoldcoin-project/bitgoldcoin,cqtenq/Feathercoin,cinnamoncoin/Feathercoin,plankton12345/litecoin,scamcoinz/scamcoin,Tetcoin/tetcoin,scamcoinz/scamcoin,shurcoin/shurcoin,plankton12345/litecoin,zemrys/vertcoin,Tetcoin/tetcoin,worldcoinproject/worldcoin-v0.8,neutrinofoundation/neutrino-digital-currency,ohac/sha1coin,DrCrypto/darkcoin,privatecoin/privatecoin,earthcoinproject/earthcoin,marscoin/marscoin,coinkeeper/2015-06-22_19-19_worldcoin,Checkcoin/checkcoin,vertcoin/eyeglass,ccoin-project/ccoin,Cancercoin/Cancercoin,gwangjin2/gwangcoin-core,zebrains/Blotter,shurcoin/shurcoin,gwangjin2/gwangcoin-core,Electronic-Gulden-Foundation/egulden,degenorate/Deftcoin,bootycoin-project/bootycoin,ghostlander/Feathercoin,stamhe/litecoin,kryptokredyt/ProjektZespolowyCoin,IlfirinIlfirin/shavercoin,dakk/soundcoin,wekuiz/wekoin,zemrys/vertcoin,alexandrcoin/vertcoin,brishtiteveja/sherlockholmescoin,tensaix2j/bananacoin,marscoin/marscoin,united-scrypt-coin-project/unitedscryptcoin,chrisfranko/aiden,KaSt/equikoin,ANCompany/birdcoin-dev,coinkeeper/2015-06-22_19-13_florincoin,razor-coin/razor,Litecoindark/LTCD,Litecoindark/LTCD,coinkeeper/2015-06-22_18-30_anoncoin,vertcoin/eyeglass,micryon/GPUcoin,nanocoins/mycoin,netswift/vertcoin,IlfirinCano/shavercoin,Dajackal/Ronpaulcoin,oklink-dev/litecoin_block,greencoin-dev/greencoin-dev,okinc/litecoin,greencoin-dev/greencoin-dev,worldcoinproject/worldcoin-v0.8,Cancercoin/Cancercoin,Checkcoin/checkcoin,ohac/sha1coin,enlighter/Feathercoin,united-scrypt-coin-project/unitedscryptcoin,stamhe/litecoin,brishtiteveja/sherlockholmescoin,coinkeeper/2015-04-19_21-20_litecoindark,okinc/litecoin,Checkcoin/checkcoin,jiffe/cosinecoin,zebrains/Blotter,CrimeaCoin/crimeacoin,bootycoin-project/bootycoin,zemrys/vertcoin,icook/vertcoin,mooncoin-project/mooncoin-landann,kryptokredyt/ProjektZespolowyCoin,franko-org/franko,coinkeeper/2015-06-22_18-46_razor,icook/vertcoin,shapiroisme/datadollar,coinkeeper/2015-06-22_19-19_worldcoin,ohac/sakuracoin,mrtexaznl/mediterraneancoin,wekuiz/wekoin,united-scrypt-coin-project/unitedscryptcoin,ronpaulcoin/ronpaulcoin,Electronic-Gulden-Foundation/egulden,degenorate/Deftcoin,worldcoinproject/worldcoin-v0.8,IlfirinIlfirin/shavercoin,cqtenq/Feathercoin,Rav3nPL/doubloons-08,ghostlander/Feathercoin,mrtexaznl/mediterraneancoin,CrimeaCoin/crimeacoin,oklink-dev/litecoin_block,coinkeeper/2015-06-22_18-30_anoncoin,mooncoin-project/mooncoin-landann,richo/dongcoin,ronpaulcoin/ronpaulcoin,koharjidan/litecoin,brightcoin/brightcoin,icook/vertcoin,coinkeeper/2015-04-19_21-20_litecoindark,Czarcoin/czarcoin,shadowoneau/ozcoin,Cancercoin/Cancercoin,degenorate/Deftcoin,Ziftr/litecoin,DrCrypto/darkcoin,brightcoin/brightcoin,CrimeaCoin/crimeacoin,Coinfigli/coinfigli,shadowoneau/ozcoin,Tetcoin/tetcoin,Coinfigli/coinfigli,Electronic-Gulden-Foundation/egulden,koharjidan/litecoin,dakk/soundcoin,IlfirinCano/shavercoin,ohac/sakuracoin,Ziftr/litecoin,IlfirinCano/shavercoin,coinkeeper/anoncoin_20150330_fixes,IlfirinCano/shavercoin,koharjidan/litecoin,WorldcoinGlobal/WorldcoinLegacy,coinkeeper/2015-06-22_19-13_florincoin,zzkt/solarcoin,okinc/litecoin,neutrinofoundation/neutrino-digital-currency,nanocoins/mycoin,novaexchange/EAC,coinkeeper/2015-06-22_18-30_anoncoin,razor-coin/razor,micryon/GPUcoin,coinkeeper/2015-04-19_21-20_litecoindark,netswift/vertcoin,saydulk/Feathercoin,coinkeeper/2015-06-22_18-51_vertcoin,saydulk/Feathercoin,zebrains/Blotter,koharjidan/litecoin,Rav3nPL/doubloons-08,chrisfranko/aiden,Checkcoin/checkcoin,shadowoneau/ozcoin,chrisfranko/aiden,bitgoldcoin-project/bitgoldcoin,Anoncoin/anoncoin,neutrinofoundation/neutrino-digital-currency,marscoin/marscoin,wekuiz/wekoin,icook/vertcoin,Dajackal/Ronpaulcoin,kryptokredyt/ProjektZespolowyCoin,Ziftr/litecoin,Electronic-Gulden-Foundation/egulden,ohac/sha1coin,Ziftr/litecoin,ccoin-project/ccoin