aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-12-24 14:16:46 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-12-24 14:16:59 +0100
commitfa2630328687645fbc7dd1ea46aac32514025715 (patch)
treedec7f62259612c04b7d911b8fc2a18b3b8cc45d5 /src
parent1be6f2dba9b79e54ffdb40ae6ac14cede61232ab (diff)
fuzz: Check that NULL_DATA is unspendable
Diffstat (limited to 'src')
-rw-r--r--src/test/fuzz/script.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp
index 892af655f6..f43689290a 100644
--- a/src/test/fuzz/script.cpp
+++ b/src/test/fuzz/script.cpp
@@ -72,6 +72,13 @@ FUZZ_TARGET_INIT(script, initialize_script)
TxoutType which_type;
(void)IsStandard(script, which_type);
+ if (which_type == TxoutType::NULL_DATA) {
+ assert(script.IsUnspendable());
+ }
+ if (script.IsUnspendable()) {
+ assert(which_type == TxoutType::NULL_DATA ||
+ which_type == TxoutType::NONSTANDARD);
+ }
(void)RecursiveDynamicUsage(script);
@@ -82,7 +89,6 @@ FUZZ_TARGET_INIT(script, initialize_script)
(void)script.IsPayToScriptHash();
(void)script.IsPayToWitnessScriptHash();
(void)script.IsPushOnly();
- (void)script.IsUnspendable();
(void)script.GetSigOpCount(/* fAccurate= */ false);
(void)FormatScript(script);