aboutsummaryrefslogtreecommitdiff
path: root/src/blockencodings.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2022-05-16 18:21:15 +0100
committerJohn Newbery <john@johnnewbery.com>2022-05-17 10:37:10 +0100
commitc65bf50b44a38bc55224d8967e0df7af60ea4f1b (patch)
treea6fa0a1e4b6336c4de3050b0f361a74babb9313d /src/blockencodings.cpp
parent6b87fa540c407d167535561ac25e3225bf76d6cc (diff)
downloadbitcoin-c65bf50b44a38bc55224d8967e0df7af60ea4f1b.tar.xz
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.cpp4
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());
}
}