mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH
Github-Pull: #8526
Rebased-From: c72c5b1e3b
This commit is contained in:
parent
633c4a1f36
commit
0027672c80
8 changed files with 101 additions and 2 deletions
|
|
@ -428,6 +428,12 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
|
|||
if (stack.size() < 1)
|
||||
return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);
|
||||
valtype& vch = stacktop(-1);
|
||||
if (sigversion == SIGVERSION_WITNESS_V0 && (flags & SCRIPT_VERIFY_MINIMALIF)) {
|
||||
if (vch.size() > 1)
|
||||
return set_error(serror, SCRIPT_ERR_MINIMALIF);
|
||||
if (vch.size() == 1 && vch[0] != 1)
|
||||
return set_error(serror, SCRIPT_ERR_MINIMALIF);
|
||||
}
|
||||
fValue = CastToBool(vch);
|
||||
if (opcode == OP_NOTIF)
|
||||
fValue = !fValue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue