From 7e95c56d61c07afb768a88bb479e353f837ab59f Mon Sep 17 00:00:00 2001 From: draoi Date: Tue, 9 Apr 2024 10:36:53 +0200 Subject: [PATCH] session: fix bitflags on mod.rs --- src/net/session/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/net/session/mod.rs b/src/net/session/mod.rs index 4e3a98f37..ab67ad0f1 100644 --- a/src/net/session/mod.rs +++ b/src/net/session/mod.rs @@ -70,7 +70,8 @@ pub async fn remove_sub_on_stop(p2p: P2pPtr, channel: ChannelPtr, type_id: Sessi "Received stop event. Removing channel {}", addr, ); - if type_id == SESSION_MANUAL || type_id == SESSION_OUTBOUND { + // Downgrade to greylist this is a outbound or manual session. + if type_id & (SESSION_MANUAL | SESSION_OUTBOUND) != 0 { debug!( target: "net::session::remove_sub_on_stop()", "Downgrading {}", addr, @@ -164,8 +165,8 @@ pub trait Session: Sync { // Perform handshake protocol_version.run(executor.clone()).await?; - // Upgrade to goldlist if outbound or manual session. - if self.type_id() == SESSION_MANUAL || self.type_id() == SESSION_OUTBOUND { + // Upgrade to goldlist if this is a outbound or manual session. + if self.type_id() & (SESSION_MANUAL | SESSION_OUTBOUND) != 0 { debug!( target: "net::session::perform_handshake_protocols()", "Upgrading {}", channel.address(),