btcsuite/btcscript

Failed to process block 96464 on testnet

Closed this issue · 2 comments

[11:21:08 2013-10-07] [WRN] [CHAN] tx 1b8bb29b851c555d1f34ab61df8f910ea0fc60d09f66dd2c9b16464b8ae1c931 failed input 0, err Invalid Opcode
[11:21:08 2013-10-07] [ERR] [BTCD] [BMGR] Failed to process block 000000000017538a71d012de3a73fcc22415b2aabf7329133c0109aa0a75b4b4: Invalid Opcode

This is due to the fact that btcscript errors on scripts with invalid opcodes regardless of them being executed or not while bitcoind has rather "interesting" handling in that it doesn't explode on invalid opcodes unless they are executed. It doesn't seem like a particularly good idea to allow invalid opcodes in a transaction script regardless of them being executed or not, but to be compatible, the same behavior is required.

The relevant code from bitcoind is:

else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
switch (opcode)
{

This hurts my brain.

This is resolved as of commit 52a1488. Tests have also been added to prevent regressions.