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

p2p: start refine_sesssion() before outbound_session()

we should perform self handshake as a priority since we will be sending
our addr in protocol addr
draoi 2 лет назад
Родитель
Сommit
ec688f485a
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/net/p2p.rs

+ 4 - 4
src/net/p2p.rs

@@ -133,12 +133,12 @@ impl P2p {
             return Err(err)
             return Err(err)
         }
         }
 
 
-        // Start the outbound session
-        self.session_outbound().start().await;
-
         // Start the refine session
         // Start the refine session
         self.session_refine().start().await;
         self.session_refine().start().await;
 
 
+        // Start the outbound session
+        self.session_outbound().start().await;
+
         info!(target: "net::p2p::start()", "[P2P] P2P subsystem started");
         info!(target: "net::p2p::start()", "[P2P] P2P subsystem started");
         Ok(())
         Ok(())
     }
     }
@@ -160,9 +160,9 @@ impl P2p {
     /// Stop the running P2P subsystem
     /// Stop the running P2P subsystem
     pub async fn stop(&self) {
     pub async fn stop(&self) {
         // Stop the sessions
         // Stop the sessions
-        self.session_refine().stop().await;
         self.session_manual().stop().await;
         self.session_manual().stop().await;
         self.session_inbound().stop().await;
         self.session_inbound().stop().await;
+        self.session_refine().stop().await;
         self.session_outbound().stop().await;
         self.session_outbound().stop().await;
     }
     }