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.
This commit is contained in:
niftynei 2023-10-27 14:13:56 -05:00 committed by Rusty Russell
parent 20c77419dc
commit 72e2e37222

View file

@ -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;
}