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

channel: remove redundant calls to self.stop()

self.stop() stops the main_receive_loop(), so we can just exit function with Error::ChannelStopped.
draoi 2 лет назад
Родитель
Сommit
497fe1d06f
1 измененных файлов с 0 добавлено и 3 удалено
  1. 0 3
      src/net/channel.rs

+ 0 - 3
src/net/channel.rs

@@ -368,8 +368,6 @@ impl Channel {
                         target: "net::channel::main_receive_loop()",
                         target: "net::channel::main_receive_loop()",
                         "Stopping channel {:?}", self
                         "Stopping channel {:?}", self
                     );
                     );
-
-                    self.stop().await;
                     return Err(Error::ChannelStopped)
                     return Err(Error::ChannelStopped)
                 }
                 }
             };
             };
@@ -390,7 +388,6 @@ impl Channel {
                         self.ban(self.address()).await;
                         self.ban(self.address()).await;
                     }
                     }
 
 
-                    self.stop().await;
                     return Err(Error::ChannelStopped)
                     return Err(Error::ChannelStopped)
                 }
                 }
                 Err(_) => unreachable!("You added a new error in notify()"),
                 Err(_) => unreachable!("You added a new error in notify()"),