Skip to content

Commit 0a24870

Browse files
ryanofskyfurszy
authored andcommitted
indexes, refactor: Stop requiring CBlockIndex type to call IsBIP30Unspendable
This commit does not change behavior in any way.
1 parent 331a25c commit 0a24870

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/index/coinstatsindex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
150150
const auto& tx{block.data->vtx.at(i)};
151151

152152
// Skip duplicate txid coinbase transactions (BIP30).
153-
if (IsBIP30Unspendable(*pindex) && tx->IsCoinBase()) {
153+
if (IsBIP30Unspendable(block.hash, block.height) && tx->IsCoinBase()) {
154154
m_total_unspendable_amount += block_subsidy;
155155
m_total_unspendables_bip30 += block_subsidy;
156156
continue;

src/validation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6341,10 +6341,10 @@ bool IsBIP30Repeat(const CBlockIndex& block_index)
63416341
(block_index.nHeight==91880 && block_index.GetBlockHash() == uint256{"00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"});
63426342
}
63436343

6344-
bool IsBIP30Unspendable(const CBlockIndex& block_index)
6344+
bool IsBIP30Unspendable(const uint256& block_hash, int block_height)
63456345
{
6346-
return (block_index.nHeight==91722 && block_index.GetBlockHash() == uint256{"00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e"}) ||
6347-
(block_index.nHeight==91812 && block_index.GetBlockHash() == uint256{"00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f"});
6346+
return (block_height==91722 && block_hash == uint256{"00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e"}) ||
6347+
(block_height==91812 && block_hash == uint256{"00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f"});
63486348
}
63496349

63506350
static fs::path GetSnapshotCoinsDBPath(Chainstate& cs) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,6 @@ bool DeploymentEnabled(const ChainstateManager& chainman, DEP dep)
13501350
bool IsBIP30Repeat(const CBlockIndex& block_index);
13511351

13521352
/** Identifies blocks which coinbase output was subsequently overwritten in the UTXO set (see BIP30) */
1353-
bool IsBIP30Unspendable(const CBlockIndex& block_index);
1353+
bool IsBIP30Unspendable(const uint256& block_hash, int block_height);
13541354

13551355
#endif // BITCOIN_VALIDATION_H

0 commit comments

Comments
 (0)