mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
lightningd: initialize channel_type field on dualopend channel creation.
Otherwise a badly-timed listpeerchannels will crash. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
336dcef541
commit
5c6e706026
2 changed files with 6 additions and 0 deletions
|
@ -246,6 +246,11 @@ struct channel *new_unsaved_channel(struct peer *peer,
|
|||
/* closer not yet known */
|
||||
channel->closer = NUM_SIDES;
|
||||
channel->close_blockheight = NULL;
|
||||
/* In case someone looks at channels before open negotiation,
|
||||
* initialize this with default */
|
||||
channel->type = default_channel_type(channel,
|
||||
ld->our_features,
|
||||
peer->their_features);
|
||||
|
||||
/* BOLT-7b04b1461739c5036add61782d58ac490842d98b #9
|
||||
* | 222/223 | `option_dual_fund`
|
||||
|
|
|
@ -1273,6 +1273,7 @@ wallet_commit_channel(struct lightningd *ld,
|
|||
} else
|
||||
channel->scb = NULL;
|
||||
|
||||
tal_free(channel->type);
|
||||
channel->type = channel_type_dup(channel, type);
|
||||
channel->scb->type = channel_type_dup(channel->scb, type);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue