Skip to content

Commit

Permalink
Remove uncontactable peers from routing table
Browse files Browse the repository at this point in the history
  • Loading branch information
AgeManning committed Sep 23, 2024
1 parent 2311070 commit 88de4c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ impl Service {
self.rpc_failure(request_id, error);
}
HandlerOut::UnverifiableEnr{enr, socket, node_id} => {
// We have received an ENR that has incorrect socket address fields
// (given the source of the pakcet we received.
// If this node exists in our routing table, remove it, as it may have shifted
// ip addresses and is now no longer contactable.
let key = kbucket::Key::from(node_id);
if self.kbuckets.write().remove(&key) {
debug!(?node_id, "Uncontactable node removed from routing table");
}
self.send_event(Event::UnverifiableEnr{enr, socket, node_id});
}
}
Expand Down

0 comments on commit 88de4c3

Please sign in to comment.