diff options
author | fanquake <fanquake@gmail.com> | 2023-06-07 15:47:50 +0200 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-06-07 15:55:36 +0200 |
commit | 2026301405f83c925ca68db6a3cd5134ed619ca7 (patch) | |
tree | be9a395539b0d1360c8bc03a070fd3e97998fb94 /src | |
parent | 6cba698a595bf1ff73885a139387b9091dbee23e (diff) | |
parent | 71200ac390fe5c10f088cbe8053b010b515757b1 (diff) |
Merge bitcoin/bitcoin#27810: fuzz: Partially revert #27780
71200ac390fe5c10f088cbe8053b010b515757b1 [fuzz] Only check duplicate coinbase script when block was valid (dergoegge)
Pull request description:
Partially revert #27780, because moving the duplicate coinbase check out of the `was_valid` branch leads to non-bug crashes in the fuzz target.
For context and further explanation see: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59516
ACKs for top commit:
MarcoFalke:
nice lgtm ACK 71200ac390fe5c10f088cbe8053b010b515757b1
Tree-SHA512: 8c38e5ff9de6331016b9a0c5e435d007d46186151b04c09085f617bb31627a28ad56678066fe152372a3ad8656f026439e3e2f9ee61d7ef588072aef8124eaa3
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/utxo_total_supply.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/fuzz/utxo_total_supply.cpp b/src/test/fuzz/utxo_total_supply.cpp index ea78edd05f..318797faf2 100644 --- a/src/test/fuzz/utxo_total_supply.cpp +++ b/src/test/fuzz/utxo_total_supply.cpp @@ -144,13 +144,13 @@ FUZZ_TARGET(utxo_total_supply) node::RegenerateCommitments(*current_block, chainman); const bool was_valid = !MineBlock(node, current_block).IsNull(); - if (duplicate_coinbase_height == ActiveHeight()) { - // we mined the duplicate coinbase - assert(current_block->vtx.at(0)->vin.at(0).scriptSig == duplicate_coinbase_script); - } - const auto prev_utxo_stats = utxo_stats; if (was_valid) { + if (duplicate_coinbase_height == ActiveHeight()) { + // we mined the duplicate coinbase + assert(current_block->vtx.at(0)->vin.at(0).scriptSig == duplicate_coinbase_script); + } + circulation += GetBlockSubsidy(ActiveHeight(), Params().GetConsensus()); } |