Skip to content

Commit 9a967d6

Browse files
rustyrussellendothermicdev
authored andcommitted
gossipd: don't try to connect to ourselves if we need more peers.
Reported-by: JssDWt Closes: #8200 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-None: trivial
1 parent 1521b92 commit 9a967d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gossipd/seeker.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,11 @@ static struct node_id *get_random_node(const tal_t *ctx,
829829
struct node_id id;
830830

831831
gossmap_node_get_id(gossmap, node, &id);
832+
832833
/* Make sure it *has* an announcement, and we're not
833834
* already connected */
834-
if (gossmap_node_get_announce(tmpctx, gossmap, node)
835+
if (!node_id_eq(&id, &seeker->daemon->id)
836+
&& gossmap_node_get_announce(tmpctx, gossmap, node)
835837
&& !find_peer(seeker->daemon, &id)) {
836838
return tal_dup(ctx, struct node_id, &id);
837839
}

0 commit comments

Comments
 (0)