diff options
author | fanquake <fanquake@gmail.com> | 2023-11-24 14:20:15 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-11-24 14:41:58 +0000 |
commit | b5a271334ca81a6adcb1c608d85c83621a9eae47 (patch) | |
tree | 37df0285ed987465bde06048e5e2aca35af1f61d /src/bench | |
parent | c0196bec98d4024d4f4d29b10ccab0d808e8ad4e (diff) | |
parent | 9e58c5bcd96e7ff2062274868814ccae0626589e (diff) | |
download | bitcoin-b5a271334ca81a6adcb1c608d85c83621a9eae47.tar.xz |
Merge bitcoin/bitcoin#28922: Use Txid in COutpoint
9e58c5bcd96e7ff2062274868814ccae0626589e Use Txid in COutpoint (dergoegge)
Pull request description:
This PR changes the type of the hash of a transaction outpoint from `uint256` to `Txid`.
ACKs for top commit:
Sjors:
ACK 9e58c5bcd96e7ff2062274868814ccae0626589e
stickies-v:
ACK 9e58c5bcd96e7ff2062274868814ccae0626589e. A sizeable diff, but very straightforward changes. Didn't see anything controversial. Left a few nits, but nothing blocking, only if you have to retouch.
TheCharlatan:
ACK 9e58c5bcd96e7ff2062274868814ccae0626589e
Tree-SHA512: 58f61ce1c58668f689513e62072a7775419c4d5af8f607669cd8cdc2e7be9645ba14af7f9e2d65da2670da3ec1ce7fc2a744037520caf799aba212fd1ac44b34
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/disconnected_transactions.cpp | 2 | ||||
-rw-r--r-- | src/bench/duplicate_inputs.cpp | 2 | ||||
-rw-r--r-- | src/bench/mempool_stress.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/bench/disconnected_transactions.cpp b/src/bench/disconnected_transactions.cpp index 91ce904dd9..f48175d472 100644 --- a/src/bench/disconnected_transactions.cpp +++ b/src/bench/disconnected_transactions.cpp @@ -28,7 +28,7 @@ struct ReorgTxns { static BlockTxns CreateRandomTransactions(size_t num_txns) { // Ensure every transaction has a different txid by having each one spend the previous one. - static uint256 prevout_hash{uint256::ZERO}; + static Txid prevout_hash{}; BlockTxns txns; txns.reserve(num_txns); diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp index a1c8d4d942..b56054ae89 100644 --- a/src/bench/duplicate_inputs.cpp +++ b/src/bench/duplicate_inputs.cpp @@ -47,7 +47,7 @@ static void DuplicateInputs(benchmark::Bench& bench) uint64_t n_inputs = (((MAX_BLOCK_SERIALIZED_SIZE / WITNESS_SCALE_FACTOR) - (CTransaction(coinbaseTx).GetTotalSize() + CTransaction(naughtyTx).GetTotalSize())) / 41) - 100; for (uint64_t x = 0; x < (n_inputs - 1); ++x) { - naughtyTx.vin.emplace_back(GetRandHash(), 0, CScript(), 0); + naughtyTx.vin.emplace_back(Txid::FromUint256(GetRandHash()), 0, CScript(), 0); } naughtyTx.vin.emplace_back(naughtyTx.vin.back()); diff --git a/src/bench/mempool_stress.cpp b/src/bench/mempool_stress.cpp index 993db66653..fe3e204fb3 100644 --- a/src/bench/mempool_stress.cpp +++ b/src/bench/mempool_stress.cpp @@ -56,7 +56,7 @@ static std::vector<CTransactionRef> CreateOrderedCoins(FastRandomContext& det_ra for (size_t ancestor = 0; ancestor < n_ancestors && !available_coins.empty(); ++ancestor){ size_t idx = det_rand.randrange(available_coins.size()); Available coin = available_coins[idx]; - uint256 hash = coin.ref->GetHash(); + Txid hash = coin.ref->GetHash(); // biased towards taking min_ancestors parents, but maybe more size_t n_to_take = det_rand.randrange(2) == 0 ? min_ancestors : |