mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
Merge #20765: fuzz: check that certain script TxoutType are nonstandard
efaf80e9bb
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 https://github.com/bitcoin/bitcoin/pull/20761 I figured this is very similar and might also be good to have ACKs for top commit: MarcoFalke: ACKefaf80e9bb
Tree-SHA512: 6f563ee3104ea9d2633aad95f1d003474bea759d0f22636c37aa91b5536a6ff0800c42447285ca8ed12f1b3699bf781dae1e5e0a3362da578749cd3164a06ea4
This commit is contained in:
commit
2dab2d239a
@ -71,7 +71,15 @@ FUZZ_TARGET_INIT(script, initialize_script)
|
||||
(void)IsSolvable(signing_provider, script);
|
||||
|
||||
TxoutType which_type;
|
||||
(void)IsStandard(script, which_type);
|
||||
bool is_standard_ret = IsStandard(script, which_type);
|
||||
if (!is_standard_ret) {
|
||||
assert(which_type == TxoutType::NONSTANDARD ||
|
||||
which_type == TxoutType::NULL_DATA ||
|
||||
which_type == TxoutType::MULTISIG);
|
||||
}
|
||||
if (which_type == TxoutType::NONSTANDARD) {
|
||||
assert(!is_standard_ret);
|
||||
}
|
||||
if (which_type == TxoutType::NULL_DATA) {
|
||||
assert(script.IsUnspendable());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user