indexes, refactor: Stop requiring CBlockIndex type to call IsBIP30Unspendable

This commit does not change behavior in any way.
This commit is contained in:
Ryan Ofsky
2022-01-24 15:02:09 -05:00
committed by furszy
parent 331a25cb16
commit 0a248708dc
3 changed files with 5 additions and 5 deletions

View File

@@ -150,7 +150,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
const auto& tx{block.data->vtx.at(i)};
// Skip duplicate txid coinbase transactions (BIP30).
if (IsBIP30Unspendable(*pindex) && tx->IsCoinBase()) {
if (IsBIP30Unspendable(block.hash, block.height) && tx->IsCoinBase()) {
m_total_unspendable_amount += block_subsidy;
m_total_unspendables_bip30 += block_subsidy;
continue;

View File

@@ -6341,10 +6341,10 @@ bool IsBIP30Repeat(const CBlockIndex& block_index)
(block_index.nHeight==91880 && block_index.GetBlockHash() == uint256{"00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"});
}
bool IsBIP30Unspendable(const CBlockIndex& block_index)
bool IsBIP30Unspendable(const uint256& block_hash, int block_height)
{
return (block_index.nHeight==91722 && block_index.GetBlockHash() == uint256{"00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e"}) ||
(block_index.nHeight==91812 && block_index.GetBlockHash() == uint256{"00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f"});
return (block_height==91722 && block_hash == uint256{"00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e"}) ||
(block_height==91812 && block_hash == uint256{"00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f"});
}
static fs::path GetSnapshotCoinsDBPath(Chainstate& cs) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)

View File

@@ -1350,6 +1350,6 @@ bool DeploymentEnabled(const ChainstateManager& chainman, DEP dep)
bool IsBIP30Repeat(const CBlockIndex& block_index);
/** Identifies blocks which coinbase output was subsequently overwritten in the UTXO set (see BIP30) */
bool IsBIP30Unspendable(const CBlockIndex& block_index);
bool IsBIP30Unspendable(const uint256& block_hash, int block_height);
#endif // BITCOIN_VALIDATION_H