Skip to content

Commit 1e0b1c5

Browse files
committed
info log to add and remove neighbors
1 parent 6e0bd5a commit 1e0b1c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stackslib/src/net/neighbors/walk.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,10 @@ impl<DB: NeighborWalkDB, NC: NeighborComms> NeighborWalk<DB, NC> {
10861086

10871087
if new {
10881088
// neighbor was new
1089+
info!(
1090+
"New neighbor added: public key: {:?} address: {:?}",
1091+
naddr.public_key_hash, naddr.addrbytes
1092+
);
10891093
self.new_frontier
10901094
.insert(neighbor.addr.clone(), neighbor.clone());
10911095
} else {
@@ -1801,6 +1805,11 @@ impl<DB: NeighborWalkDB, NC: NeighborComms> NeighborWalk<DB, NC> {
18011805
}
18021806
StacksMessageType::Nack(ref data) => {
18031807
// evict
1808+
info!(
1809+
"Dropping neighbor {:?} Reason: will Evict message: {:?}",
1810+
nkey.public_key_hash,
1811+
message.get_message_name()
1812+
);
18041813
debug!(
18051814
"{:?}: Neighbor {:?} NACK'ed Handshake with code {:?}; will evict",
18061815
network.get_local_peer(),
@@ -1812,6 +1821,7 @@ impl<DB: NeighborWalkDB, NC: NeighborComms> NeighborWalk<DB, NC> {
18121821
}
18131822
_ => {
18141823
// unexpected reply -- this peer is misbehaving and should be replaced
1824+
info!("Dropping neighbor {:?} Reason: unexpected reply {:?} this peer is misbehaving and should be replaced", nkey.public_key_hash, message.get_message_name());
18151825
debug!("{:?}: Neighbor {:?} replied an out-of-sequence message (type {}); will replace", network.get_local_peer(), &nkey, message.get_message_name());
18161826
self.comms.add_broken(network, &nkey);
18171827
continue;

0 commit comments

Comments
 (0)