-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DropReason and DropPeer structs to pass reason string to logs about Dropping a Neighbor #5720
base: develop
Are you sure you want to change the base?
Conversation
…with them Signed-off-by: Jacinta Ferrant <[email protected]>
I like this approach overall. I think it may be worth consolidating Can this PR also implement a better formatter for |
Can do! EDIT: just a quick question, does this mean the event_id is not really relevant for matching on a neighbor key? just the neighbor_key.addrbytes, i.e. PeerAddress? Specifically...can multiple neighbor_keys with the same peer_address (even if sep port) match to the same event_id... Cause then it might not be so straightforward cause deregister_peer highly relies on event_id. For example I see this in deregister_peer which makes me think that there are multiple matching neighbor keys per event id... let mut nk_remove: Vec<(NeighborKey, Hash160)> = vec![];
for (neighbor_key, ev_id) in self.events.iter() {
if event_id == ev_id {
let pubkh = self
.get_p2p_convo(event_id)
.and_then(|convo| convo.get_public_key_hash())
.unwrap_or(Hash160([0x00; 20]));
nk_remove.push((neighbor_key.clone(), pubkh, event_id));
}
} |
… into chore/add-drop-reason-to-p2p-logs
…mplementation of fmt::Display Signed-off-by: Jacinta Ferrant <[email protected]>
The system won't register a new socket to a peer that already has a socket open, so there won't be multiple |
Perfect! This was my only concern I think. so I should be able ot make this work. |
… into chore/add-drop-reason-to-p2p-logs
Signed-off-by: Jacinta Ferrant <[email protected]>
A couple things you could add here, potentially:
|
Closes #5714