From fe0801bcf1f409fd8a8c5be2150e366a28cec1dd Mon Sep 17 00:00:00 2001 From: draoi Date: Sun, 7 Apr 2024 16:43:31 +0200 Subject: [PATCH] outbound_session: fix bug causing nodes to get stuck in peer discovery ie. if we have gold or white connections we should try to connect to them. --- src/net/session/outbound_session.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/net/session/outbound_session.rs b/src/net/session/outbound_session.rs index a799d936c..b013c8b22 100644 --- a/src/net/session/outbound_session.rs +++ b/src/net/session/outbound_session.rs @@ -296,9 +296,12 @@ impl Slot { self.slot, ); - // Do peer discovery if we don't have a hostlist (first time connecting - // to the network). - if hosts.container.is_empty(HostColor::Grey).await { + // Do peer discovery if we don't have any peers on the Grey, White or Gold list + // (first time connecting to the network). + if hosts.container.is_empty(HostColor::Grey).await && + hosts.container.is_empty(HostColor::White).await && + hosts.container.is_empty(HostColor::Gold).await + { dnetev!(self, OutboundSlotSleeping, { slot: self.slot, });