mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-06 21:19:35 +01:00
Fix 11-year-old mis-categorized error code in OP_IF evaluation
This was introduced by commit ab9edbd6b6.
It appears the original author may have gotten tired and pasted the wrong
error code into this 1 place. Every other situation where the value stack
lacks the required number of arguments for the op-code,
SCRIPT_ERR_INVALID_STACK_OPERATION is reported. Not so here.
This commit fixes the situation.
Also in this commit:
- Fix script_tests to adjust to the corrected error message
- Fix p2p_invalid_tx functional test to produce the desired error message
This commit is contained in:
@@ -607,7 +607,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
|
||||
if (fExec)
|
||||
{
|
||||
if (stack.size() < 1)
|
||||
return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);
|
||||
return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
|
||||
valtype& vch = stacktop(-1);
|
||||
// Tapscript requires minimal IF/NOTIF inputs as a consensus rule.
|
||||
if (sigversion == SigVersion::TAPSCRIPT) {
|
||||
|
||||
Reference in New Issue
Block a user