mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
validation, index: Add unspendable coinbase helper functions
Making the checks to identify BIP30 available outside of validation.cpp is needed for reporting and tracking statistics on specific blocks and the UTXO set correctly.
This commit is contained in:
@@ -2083,8 +2083,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
||||
// Now that the whole chain is irreversibly beyond that time it is applied to all blocks except the
|
||||
// two in the chain that violate it. This prevents exploiting the issue against nodes during their
|
||||
// initial block download.
|
||||
bool fEnforceBIP30 = !((pindex->nHeight==91842 && pindex->GetBlockHash() == uint256S("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) ||
|
||||
(pindex->nHeight==91880 && pindex->GetBlockHash() == uint256S("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721")));
|
||||
bool fEnforceBIP30 = !IsBIP30Repeat(*pindex);
|
||||
|
||||
// Once BIP34 activated it was not possible to create new duplicate coinbases and thus other than starting
|
||||
// with the 2 existing duplicate coinbase pairs, not possible to create overwriting txs. But by the
|
||||
@@ -5290,3 +5289,15 @@ Chainstate& ChainstateManager::ActivateExistingSnapshot(CTxMemPool* mempool, uin
|
||||
m_active_chainstate = m_snapshot_chainstate.get();
|
||||
return *m_snapshot_chainstate;
|
||||
}
|
||||
|
||||
bool IsBIP30Repeat(const CBlockIndex& block_index)
|
||||
{
|
||||
return (block_index.nHeight==91842 && block_index.GetBlockHash() == uint256S("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) ||
|
||||
(block_index.nHeight==91880 && block_index.GetBlockHash() == uint256S("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"));
|
||||
}
|
||||
|
||||
bool IsBIP30Unspendable(const CBlockIndex& block_index)
|
||||
{
|
||||
return (block_index.nHeight==91722 && block_index.GetBlockHash() == uint256S("0x00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e")) ||
|
||||
(block_index.nHeight==91812 && block_index.GetBlockHash() == uint256S("0x00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user