mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
Use Txid in COutpoint
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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 :
|
||||
|
||||
Reference in New Issue
Block a user