diff options
author | John Newbery <john@johnnewbery.com> | 2022-05-16 18:21:15 +0100 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2022-05-17 10:37:10 +0100 |
commit | c65bf50b44a38bc55224d8967e0df7af60ea4f1b (patch) | |
tree | a6fa0a1e4b6336c4de3050b0f361a74babb9313d /src/blockencodings.cpp | |
parent | 6b87fa540c407d167535561ac25e3225bf76d6cc (diff) |
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
Diffstat (limited to 'src/blockencodings.cpp')
-rw-r--r-- | src/blockencodings.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index 2a7bf9397c..f96353510f 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -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()); } } |