aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-04-04 17:18:57 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-04-04 17:30:24 -0700
commit88430cbab4dca36b6a867364cab319cde6a9ebca (patch)
treec5c687eb1633b3068b87ec2a9f90905745d07de5 /src/script
parentbfaed1ab2ec7fb3a1a6a7ed0b84503c2ed461c67 (diff)
parent1e747e3c1e04a38c5ed6e8f8cd14077b8b7377c9 (diff)
Merge #12167: Make segwit failure due to CLEANSTACK violation return a SCRIPT_ERR_CLEANSTACK error code
1e747e3c1e Make segwit failure due to CLEANSTACK violation return a SCRIPT_ERR_CLEANSTACK error code. (Mark Friedenbach) Pull request description: If a segwit script terminates with a stack size not equal to one, the current error code is EVAL_FALSE. This is semantically wrong, and prevents explicitly checking CLEANSTACK violations in the unit tests. This PR changes the error code (and affected unit tests) to use SCRIPT_ERROR_CLEANSTACK instead of SCRIPT_ERROR_EVAL_FALSE. Tree-SHA512: 8f7b1650f7a23a942cde1070e3e56420be456b4a7be42515b237e95557bf2bd5e7ba9aabd213c8092bea28c165dbe73f5a3486300089aeb01e698151b42484b1
Diffstat (limited to 'src/script')
-rw-r--r--src/script/interpreter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 85dd0a8a81..182f4a3327 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -1402,7 +1402,7 @@ static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion,
// Scripts inside witness implicitly require cleanstack behaviour
if (stack.size() != 1)
- return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
+ return set_error(serror, SCRIPT_ERR_CLEANSTACK);
if (!CastToBool(stack.back()))
return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
return true;