mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
outbound_session: suspend a peer that fails the version exchange
This commit is contained in:
@@ -228,7 +228,7 @@ impl HostState {
|
||||
match self {
|
||||
HostState::Insert => Err(Error::HostStateBlocked(start, end)),
|
||||
HostState::Refine => Err(Error::HostStateBlocked(start, end)),
|
||||
HostState::Connect => Err(Error::HostStateBlocked(start, end)),
|
||||
HostState::Connect => Ok(HostState::Suspend),
|
||||
HostState::Suspend => Err(Error::HostStateBlocked(start, end)),
|
||||
HostState::Connected(_) => Err(Error::HostStateBlocked(start, end)),
|
||||
HostState::Move => Ok(HostState::Suspend),
|
||||
|
||||
@@ -420,6 +420,16 @@ impl Slot {
|
||||
});
|
||||
|
||||
self.channel_id.store(0, Ordering::Relaxed);
|
||||
|
||||
warn!(
|
||||
target: "net::outbound_session::try_connect()",
|
||||
"[P2P] Suspending addr= [{}] slot #{}",
|
||||
addr, slot
|
||||
);
|
||||
|
||||
// Mark its state as Suspend, which sends this node to the Refinery for processing.
|
||||
self.p2p().hosts().try_register(addr.clone(), HostState::Suspend).await.unwrap();
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user