Skip to content

Commit

Permalink
Merge pull request #4115 from driftluo/fix-missing-await
Browse files Browse the repository at this point in the history
fix: fix disconnect miss await
  • Loading branch information
zhangsoledad authored Aug 25, 2023
2 parents b82b336 + d7fe438 commit 44d8a76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions network/src/protocols/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ impl ServiceProtocol for CKBHandler {
.network_state
.ckb2023
.load(std::sync::atomic::Ordering::SeqCst)
&& version != "3"
&& version != crate::protocols::support_protocols::LASTEST_VERSION
&& context.proto_id != SupportProtocols::RelayV2.protocol_id()
{
debug!(
"session {}, protocol {} with version {}, not 3, so disconnect it",
context.session.id, context.proto_id, version
);
let id = context.session.id;
let _ignore = context.disconnect(id);
let _ignore = context.disconnect(id).await;
return;
}
self.network_state.with_peer_registry_mut(|reg| {
Expand Down
2 changes: 1 addition & 1 deletion network/src/protocols/support_protocols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use p2p::{
};
use tokio_util::codec::length_delimited;

const LASTEST_VERSION: &str = "3";
pub const LASTEST_VERSION: &str = "3";

/// All supported protocols
///
Expand Down

0 comments on commit 44d8a76

Please sign in to comment.