diff --git a/include/bitcoin/system/impl/machine/interpreter.ipp b/include/bitcoin/system/impl/machine/interpreter.ipp index 4e140756b8..3091b45f8d 100644 --- a/include/bitcoin/system/impl/machine/interpreter.ipp +++ b/include/bitcoin/system/impl/machine/interpreter.ipp @@ -19,7 +19,6 @@ #ifndef LIBBITCOIN_SYSTEM_MACHINE_INTERPRETER_IPP #define LIBBITCOIN_SYSTEM_MACHINE_INTERPRETER_IPP -#include "bitcoin/system/chain/prevout.hpp" #include #include #include @@ -1721,11 +1720,18 @@ code interpreter::connect_witness(const context& state, // A defined version indicates bip141 is active. interpreter program(tx, it, script, state.flags, version, stack); if ((ec = program.run())) + { return ec; - - // A v0 script must succeed with a clean true stack (bip141). - return program.is_true(true) ? error::script_success : - error::stack_false; + } + else if (!program.is_true(true)) + { + // A v0 script must succeed with a clean true stack (bip141). + return error::stack_false; + } + else + { + return error::script_success; + } } // These versions are reserved for future extensions (bip141).