Procházet zdrojové kódy

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.
draoi před 2 roky
rodič
revize
fe0801bcf1
1 změnil soubory, kde provedl 6 přidání a 3 odebrání
  1. 6 3
      src/net/session/outbound_session.rs

+ 6 - 3
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,
                 });