mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-20 19:09:26 +01:00
Remove fUseWTXID parameter from CBlockHeaderAndShortTxIDs constructor
All uses of CBlockHeaderAndShortTxIDs in the product code are constructed with fUseWTXID=true, so remove the parameter. There is one use of the CBlockHeaderAndShortTxIDs constructor with fUseWTXID=false in the unit tests. This is used to construct a CBlockHeaderAndShortTxIDs for a block with only the coinbase transaction, so setting fUseWTXID to true or false makes no difference. Suggested in https://github.com/bitcoin/bitcoin/pull/20799#pullrequestreview-963480278
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
CBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(const CBlock& block, bool fUseWTXID) :
|
||||
CBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(const CBlock& block) :
|
||||
nonce(GetRand<uint64_t>()),
|
||||
shorttxids(block.vtx.size() - 1), prefilledtxn(1), header(block) {
|
||||
FillShortTxIDSelector();
|
||||
@@ -24,7 +24,7 @@ CBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(const CBlock& block, bool f
|
||||
prefilledtxn[0] = {0, block.vtx[0]};
|
||||
for (size_t i = 1; i < block.vtx.size(); i++) {
|
||||
const CTransaction& tx = *block.vtx[i];
|
||||
shorttxids[i - 1] = GetShortID(fUseWTXID ? tx.GetWitnessHash() : tx.GetHash());
|
||||
shorttxids[i - 1] = GetShortID(tx.GetWitnessHash());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user