Skip to content

Commit 2dab2d2

Browse files
author
MarcoFalke
committed
Merge #20765: fuzz: check that certain script TxoutType are nonstandard
efaf80e fuzz: check that certain script TxoutType are nonstandard (Michael Dietz) Pull request description: - Every transaction of type NONSTANDARD must not be a standard script - The only know types of nonstandard scripts are NONSTANDARD and certain NULL_DATA and MULTISIG scripts When reviewing bitcoin/bitcoin#20761 I figured this is very similar and might also be good to have ACKs for top commit: MarcoFalke: ACK efaf80e Tree-SHA512: 6f563ee3104ea9d2633aad95f1d003474bea759d0f22636c37aa91b5536a6ff0800c42447285ca8ed12f1b3699bf781dae1e5e0a3362da578749cd3164a06ea4
2 parents 6e70674 + efaf80e commit 2dab2d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/fuzz/script.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ FUZZ_TARGET_INIT(script, initialize_script)
7171
(void)IsSolvable(signing_provider, script);
7272

7373
TxoutType which_type;
74-
(void)IsStandard(script, which_type);
74+
bool is_standard_ret = IsStandard(script, which_type);
75+
if (!is_standard_ret) {
76+
assert(which_type == TxoutType::NONSTANDARD ||
77+
which_type == TxoutType::NULL_DATA ||
78+
which_type == TxoutType::MULTISIG);
79+
}
80+
if (which_type == TxoutType::NONSTANDARD) {
81+
assert(!is_standard_ret);
82+
}
7583
if (which_type == TxoutType::NULL_DATA) {
7684
assert(script.IsUnspendable());
7785
}

0 commit comments

Comments
 (0)