Skip to content

Commit 2026301

Browse files
committed
Merge bitcoin/bitcoin#27810: fuzz: Partially revert #27780
71200ac [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 71200ac Tree-SHA512: 8c38e5ff9de6331016b9a0c5e435d007d46186151b04c09085f617bb31627a28ad56678066fe152372a3ad8656f026439e3e2f9ee61d7ef588072aef8124eaa3
2 parents 6cba698 + 71200ac commit 2026301

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/fuzz/utxo_total_supply.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ FUZZ_TARGET(utxo_total_supply)
144144
node::RegenerateCommitments(*current_block, chainman);
145145
const bool was_valid = !MineBlock(node, current_block).IsNull();
146146

147-
if (duplicate_coinbase_height == ActiveHeight()) {
148-
// we mined the duplicate coinbase
149-
assert(current_block->vtx.at(0)->vin.at(0).scriptSig == duplicate_coinbase_script);
150-
}
151-
152147
const auto prev_utxo_stats = utxo_stats;
153148
if (was_valid) {
149+
if (duplicate_coinbase_height == ActiveHeight()) {
150+
// we mined the duplicate coinbase
151+
assert(current_block->vtx.at(0)->vin.at(0).scriptSig == duplicate_coinbase_script);
152+
}
153+
154154
circulation += GetBlockSubsidy(ActiveHeight(), Params().GetConsensus());
155155
}
156156

0 commit comments

Comments
 (0)