From 72e2e37222da7d5ce534eed6ef2bd1c7236e8f21 Mon Sep 17 00:00:00 2001 From: niftynei Date: Fri, 27 Oct 2023 14:13:56 -0500 Subject: [PATCH] init channel: only fill in wscript if requested We don't actually use this internal to this method? Weird. Anyway, if we don't want/need it allow the caller to signal that by passing in NULL, if desired. --- common/initial_channel.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/initial_channel.c b/common/initial_channel.c index 8d073c32f..7415a2c42 100644 --- a/common/initial_channel.c +++ b/common/initial_channel.c @@ -119,10 +119,6 @@ struct bitcoin_tx *initial_channel_tx(const tal_t *ctx, channel->opener, side); - *wscript = bitcoin_redeem_2of2(ctx, - &channel->funding_pubkey[side], - &channel->funding_pubkey[!side]); - init_tx = initial_commit_tx(ctx, &channel->funding, channel->funding_sats, channel->funding_pubkey, @@ -149,6 +145,12 @@ struct bitcoin_tx *initial_channel_tx(const tal_t *ctx, &channel->funding_pubkey[!side], false /* is_taproot */); } + if (wscript) { + *wscript = bitcoin_redeem_2of2(ctx, + &channel->funding_pubkey[side], + &channel->funding_pubkey[!side]); + } + return init_tx; }