From cbad9a1fa59b2e945f6a8db9c801823326a5320d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 4 Jun 2015 21:04:50 +0930 Subject: [PATCH] bitcoin_script: remember to push extra 0 for OP_CHECKMULTISIG. Signed-off-by: Rusty Russell --- bitcoin_script.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitcoin_script.c b/bitcoin_script.c index 5665a879e..8e8ac2057 100644 --- a/bitcoin_script.c +++ b/bitcoin_script.c @@ -279,6 +279,8 @@ u8 *scriptsig_p2sh_2of2(const tal_t *ctx, u8 *script = tal_arr(ctx, u8, 0); u8 *redeemscript; + /* OP_CHECKMULTISIG has an out-by-one bug, which MBZ */ + add_number(&script, 0); add_push_sig(&script, sig1); add_push_sig(&script, sig2);