From f0fa01b4396d259c8f86f26496b70d83f06fe1c2 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Sat, 9 Dec 2017 12:23:56 +0000 Subject: [PATCH] Share similar code between bitcoin_witness_p2sh_p2wpkh and bitcoin_scriptsig_p2sh_p2wpkh. Note that bitcoin_witness_p2sh_p2wpkh is not actually used in current code. --- bitcoin/script.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bitcoin/script.c b/bitcoin/script.c index 83273dd35..0714b2a4d 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -258,14 +258,7 @@ void bitcoin_witness_p2sh_p2wpkh(const tal_t *ctx, const secp256k1_ecdsa_signature *sig, const struct pubkey *key) { - u8 *redeemscript = bitcoin_redeem_p2sh_p2wpkh(ctx, key); - - /* BIP141: The scriptSig must be exactly a push of the BIP16 redeemScript - * or validation fails. */ - input->script = tal_arr(ctx, u8, 0); - add_push_bytes(&input->script, redeemscript, tal_count(redeemscript)); - tal_free(redeemscript); - + input->script = bitcoin_scriptsig_p2sh_p2wpkh(ctx, key); input->witness = bitcoin_witness_p2wpkh(ctx, sig, key); }