txs: Move commit tx generation out of the signature computation

We need the txs around, so don't throw them away after generating them.
This commit is contained in:
Christian Decker
2020-05-07 10:13:34 +09:30
committed by Rusty Russell
parent 667a763659
commit eb8eabcc3c
13 changed files with 108 additions and 45 deletions

View File

@@ -272,6 +272,7 @@ static void add_htlcs(struct bitcoin_tx ***txs,
/* FIXME: We could cache these. */
struct bitcoin_tx **channel_txs(const tal_t *ctx,
const struct htlc ***htlcmap,
struct wally_tx_output *direct_outputs[NUM_SIDES],
const u8 **funding_wscript,
const struct channel *channel,
const struct pubkey *per_commitment_point,
@@ -299,8 +300,9 @@ struct bitcoin_tx **channel_txs(const tal_t *ctx,
channel->config[!side].to_self_delay, &keyset,
channel_feerate(channel, side),
channel->config[side].dust_limit, channel->view[side].owed[side],
channel->view[side].owed[!side], committed, htlcmap,
commitment_number ^ channel->commitment_number_obscurer, side);
channel->view[side].owed[!side], committed, htlcmap, direct_outputs,
commitment_number ^ channel->commitment_number_obscurer,
side);
/* Generating and saving witness script required to spend
* the funding output */