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:
Calin Culianu
2025-03-26 08:12:39 -05:00
parent c0b7159de4
commit a7b581423e
3 changed files with 14 additions and 14 deletions

View File

@@ -229,7 +229,7 @@ class InvalidOPIFConstruction(BadTxTemplate):
def get_tx(self):
return create_tx_with_script(
self.spend_tx, 0, script_sig=b'\x64' * 35,
self.spend_tx, 0, script_sig=b'\x68' * 35,
amount=(self.spend_avail // 2))