Skip to content

Commit

Permalink
Code review comment: clear inventory state regardless of event id
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <[email protected]>
  • Loading branch information
jferrant committed Feb 3, 2025
1 parent f5881e6 commit e689338
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions stackslib/src/net/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2116,21 +2116,6 @@ impl PeerNetwork {
"public addr" => nk.addrbytes.pretty_print(),
"reason" => %reason
);
// remove inventory state
if let Some(inv_state) = self.inv_state.as_mut() {
debug!(
"{:?}: Remove inventory state for epoch 2.x {nk:?}",
&self.local_peer
);
inv_state.del_peer(&nk);
}
if let Some(inv_state) = self.inv_state_nakamoto.as_mut() {
debug!(
"{:?}: Remove inventory state for Nakamoto {nk:?}",
&self.local_peer
);
inv_state.del_peer(&NeighborAddress::from_neighbor_key(nk.clone(), pubkh));
}
self.pending_messages.remove(&(event_id, nk.clone()));
self.pending_stacks_messages.remove(&(event_id, nk.clone()));

Expand All @@ -2152,6 +2137,21 @@ impl PeerNetwork {
self.relay_handles.remove(&event_id);
self.peers.remove(&event_id);
}
// remove inventory state
if let Some(inv_state) = self.inv_state.as_mut() {
debug!(
"{:?}: Remove inventory state for epoch 2.x {nk:?}",
&self.local_peer
);
inv_state.del_peer(&nk);
}
if let Some(inv_state) = self.inv_state_nakamoto.as_mut() {
debug!(
"{:?}: Remove inventory state for Nakamoto {nk:?}",
&self.local_peer
);
inv_state.del_peer(&NeighborAddress::from_neighbor_key(nk.clone(), pubkh));
}
}
}

Expand Down

0 comments on commit e689338

Please sign in to comment.