Просмотр исходного кода

manual_session: fix death loop

We must stop tracking a peer if connecting to it has failed, i.e.
Pending peers must either transition to Connected or None, otherwise
they will be stuck in the Pending state forever.
draoi 2 лет назад
Родитель
Сommit
36ecfb18e2
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      src/net/session/manual_session.rs

+ 5 - 0
src/net/session/manual_session.rs

@@ -157,6 +157,11 @@ impl ManualSession {
                         "[P2P] Unable to connect to manual outbound [{}]: {}",
                         addr, e,
                     );
+
+                // Stop tracking this address in the HostRegistry.
+                // Otherwise, host will be stuck in Pending state.
+                self.p2p().hosts().remove(&addr).await;
+
                 }
             }