Skip to content

Commit 0b4b4c5

Browse files
committed
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 <[email protected]>
1 parent bf54913 commit 0b4b4c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightningd/opening_control.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,10 @@ static struct channel *stub_chan(struct command *cmd,
14731473
log_debug(cmd->ld->log, "channel %s already exists!",
14741474
fmt_channel_id(tmpctx, &cid));
14751475
return NULL;
1476-
} else {
1476+
}
1477+
1478+
peer = peer_by_id(cmd->ld, &nodeid);
1479+
if (!peer) {
14771480
struct wireaddr_internal wint;
14781481

14791482
wint.itype = ADDR_INTERNAL_WIREADDR;

0 commit comments

Comments
 (0)