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:
Rusty Russell
2023-06-26 08:26:21 +09:30
parent 336dcef541
commit 5c6e706026
2 changed files with 6 additions and 0 deletions

View File

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