mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-28 19:34:25 +01:00
channeld: don't allow NULL htlcmap for full_channel
That was only for the initial state, which is now in initial_channel.c. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
66a07461d3
commit
7e13e9e457
@@ -250,10 +250,6 @@ struct bitcoin_tx **channel_txs(const tal_t *ctx,
|
||||
/* Figure out what @side will already be committed to. */
|
||||
gather_htlcs(ctx, channel, side, &committed, NULL, NULL);
|
||||
|
||||
/* NULL map only allowed at beginning, when we know no HTLCs */
|
||||
if (!htlcmap)
|
||||
assert(tal_count(committed) == 0);
|
||||
|
||||
txs = tal_arr(ctx, struct bitcoin_tx *, 1);
|
||||
txs[0] = commit_tx(ctx, &channel->funding_txid,
|
||||
channel->funding_txout,
|
||||
@@ -275,8 +271,7 @@ struct bitcoin_tx **channel_txs(const tal_t *ctx,
|
||||
&channel->funding_pubkey[side],
|
||||
&channel->funding_pubkey[!side]);
|
||||
|
||||
if (htlcmap)
|
||||
add_htlcs(&txs, wscripts, *htlcmap, channel, &keyset, side);
|
||||
add_htlcs(&txs, wscripts, *htlcmap, channel, &keyset, side);
|
||||
|
||||
tal_free(committed);
|
||||
return txs;
|
||||
|
||||
@@ -43,16 +43,15 @@ struct channel *new_channel(const tal_t *ctx,
|
||||
* channel_txs: Get the current commitment and htlc txs for the channel.
|
||||
* @ctx: tal context to allocate return value from.
|
||||
* @channel: The channel to evaluate
|
||||
* @htlc_map: Pointer to htlcs for each tx output (allocated off @ctx) or NULL.
|
||||
* @htlc_map: Pointer to htlcs for each tx output (allocated off @ctx).
|
||||
* @wscripts: Pointer to array of wscript for each tx returned (alloced off @ctx)
|
||||
* @per_commitment_point: Per-commitment point to determine keys
|
||||
* @commitment_number: The index of this commitment.
|
||||
* @side: which side to get the commitment transaction for
|
||||
*
|
||||
* Returns the unsigned commitment transaction for the committed state
|
||||
* for @side, followed by the htlc transactions in output order, and
|
||||
* fills in @htlc_map (if not NULL), or NULL on key derivation
|
||||
* failure.
|
||||
* for @side, followed by the htlc transactions in output order and
|
||||
* fills in @htlc_map, or NULL on key derivation failure.
|
||||
*/
|
||||
struct bitcoin_tx **channel_txs(const tal_t *ctx,
|
||||
const struct htlc ***htlcmap,
|
||||
|
||||
Reference in New Issue
Block a user