Adjust consensus rule to accept genesis block without height in coinbase
Closes #1753
This commit is contained in:
@@ -3090,7 +3090,10 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
|
||||
|
||||
// Enforce block.nVersion=2 rule that the coinbase starts with serialized block height
|
||||
// if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet):
|
||||
if (block.nVersion >= 2)
|
||||
// Since MIN_BLOCK_VERSION = 4 all blocks with nHeight > 0 should satisfy this.
|
||||
// This rule is not applied to the genesis block, which didn't include the height
|
||||
// in the coinbase.
|
||||
if (nHeight > 0)
|
||||
{
|
||||
CScript expect = CScript() << nHeight;
|
||||
if (block.vtx[0].vin[0].scriptSig.size() < expect.size() ||
|
||||
|
||||
Reference in New Issue
Block a user