lightningd: don't create a second peer on stub recover if one already exists.

This was confusing to debug, but if the peer already exists we must not
create a second one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-08-03 12:08:08 +09:30
parent bf549130d6
commit 0b4b4c5e03

View file

@ -1473,7 +1473,10 @@ static struct channel *stub_chan(struct command *cmd,
log_debug(cmd->ld->log, "channel %s already exists!",
fmt_channel_id(tmpctx, &cid));
return NULL;
} else {
}
peer = peer_by_id(cmd->ld, &nodeid);
if (!peer) {
struct wireaddr_internal wint;
wint.itype = ADDR_INTERNAL_WIREADDR;