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 Dec 1, 2021
1 parent 951dbc9 commit ef0d790
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 @@ -365,7 +365,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 ef0d790

Please sign in to comment.