Skip to content

Commit 6a0d048

Browse files
authored
Merge pull request #5459 from stacks-network/logs/info-neighbor-add-and-remove
Add info logs for adding and removing a neighbor
2 parents 819440b + 90cc224 commit 6a0d048

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

stackslib/src/net/p2p.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,11 @@ impl PeerNetwork {
18101810
};
18111811

18121812
match self.can_register_peer(&neighbor_key, outbound) {
1813-
Ok(_) => {}
1813+
Ok(_) => {
1814+
info!("Neighbor accepted!";
1815+
"public key" => ?pubkey_opt,
1816+
"address" => %neighbor_key.addrbytes);
1817+
}
18141818
Err(e) => {
18151819
debug!(
18161820
"{:?}: Could not register peer {:?}: {:?}",
@@ -1905,6 +1909,11 @@ impl PeerNetwork {
19051909
for (nk, pubkh) in nk_remove.into_iter() {
19061910
// remove event state
19071911
self.events.remove(&nk);
1912+
info!("Dropping neighbor!";
1913+
"event id" => %event_id,
1914+
"public address" => %pubkh,
1915+
"public key" => %nk.addrbytes
1916+
);
19081917

19091918
// remove inventory state
19101919
if let Some(inv_state) = self.inv_state.as_mut() {

0 commit comments

Comments
 (0)