diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2020-12-24 00:11:40 +0100 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2022-10-23 01:33:36 +0200 |
commit | cb94db119f4643f49da63520d64efc99fb0c0795 (patch) | |
tree | 536bf2e7e7be4244947e7f7de553bdc0298ef6d0 /src/index | |
parent | 6d4048468430d9d1fe5e7c5fcda13708879d1083 (diff) | |
download | bitcoin-cb94db119f4643f49da63520d64efc99fb0c0795.tar.xz |
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.
Diffstat (limited to 'src/index')
-rw-r--r-- | src/index/coinstatsindex.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp index d3559b1b75..271e5bb1f6 100644 --- a/src/index/coinstatsindex.cpp +++ b/src/index/coinstatsindex.cpp @@ -144,17 +144,13 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block) } } - // TODO: Deduplicate BIP30 related code - bool is_bip30_block{(block.height == 91722 && block.hash == uint256S("0x00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e")) || - (block.height == 91812 && block.hash == uint256S("0x00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f"))}; - // Add the new utxos created from the block assert(block.data); for (size_t i = 0; i < block.data->vtx.size(); ++i) { const auto& tx{block.data->vtx.at(i)}; // Skip duplicate txid coinbase transactions (BIP30). - if (is_bip30_block && tx->IsCoinBase()) { + if (IsBIP30Unspendable(*pindex) && tx->IsCoinBase()) { m_total_unspendable_amount += block_subsidy; m_total_unspendables_bip30 += block_subsidy; continue; |