Skip to content

Commit

Permalink
Avoid adding ready services for outdated peers
Browse files Browse the repository at this point in the history
If a service becomes ready but it's for a connection to an outdated
peer, drop it.
  • Loading branch information
jvff committed Nov 28, 2021
1 parent b844b9c commit 037da4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zebra-network/src/peer_set/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ where
trace!(?key, "service became ready");
let cancel = self.cancel_handles.remove(&key);
assert!(cancel.is_some(), "missing cancel handle");
self.ready_services.insert(key, svc);

if svc.version() >= self.minimum_peer_version.current() {
self.ready_services.insert(key, svc);
}
}

// Unready -> Canceled
Expand Down

0 comments on commit 037da4b

Please sign in to comment.