mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +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:
@@ -246,6 +246,11 @@ struct channel *new_unsaved_channel(struct peer *peer,
|
|||||||
/* closer not yet known */
|
/* closer not yet known */
|
||||||
channel->closer = NUM_SIDES;
|
channel->closer = NUM_SIDES;
|
||||||
channel->close_blockheight = NULL;
|
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
|
/* BOLT-7b04b1461739c5036add61782d58ac490842d98b #9
|
||||||
* | 222/223 | `option_dual_fund`
|
* | 222/223 | `option_dual_fund`
|
||||||
|
|||||||
@@ -1273,6 +1273,7 @@ wallet_commit_channel(struct lightningd *ld,
|
|||||||
} else
|
} else
|
||||||
channel->scb = NULL;
|
channel->scb = NULL;
|
||||||
|
|
||||||
|
tal_free(channel->type);
|
||||||
channel->type = channel_type_dup(channel, type);
|
channel->type = channel_type_dup(channel, type);
|
||||||
channel->scb->type = channel_type_dup(channel->scb, type);
|
channel->scb->type = channel_type_dup(channel->scb, type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user