bitcoin_script: fix bug in complex anchor redeem script.

We need to pop off the stack after OP_CHECKSEQUENCEVERIFY.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-06-08 09:26:14 +09:30
parent 3a4d8cd282
commit 114b7afbe2

View File

@@ -17,6 +17,7 @@
#define OP_ELSE 0x67
#define OP_ENDIF 0x68
#define OP_DEPTH 0x74
#define OP_DROP 0x75
#define OP_DUP 0x76
#define OP_EQUAL 0x87
#define OP_EQUALVERIFY 0x88
@@ -377,6 +378,7 @@ u8 *bitcoin_redeem_revocable(const tal_t *ctx,
add_op(&script, OP_ELSE);
add_push_bytes(&script, &locktime_le, sizeof(locktime_le));
add_op(&script, OP_CHECKSEQUENCEVERIFY);
add_op(&script, OP_DROP);
add_push_key(&script, mykey);
add_op(&script, OP_CHECKSIG);
add_op(&script, OP_ENDIF);