Skip to content

Commit 90134db

Browse files
committed
move logs to add/remove neighbor to p2p session
1 parent abbeca4 commit 90134db

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

stackslib/src/net/neighbors/walk.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,10 +1086,6 @@ 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-
);
10931089
self.new_frontier
10941090
.insert(neighbor.addr.clone(), neighbor.clone());
10951091
} else {
@@ -1805,11 +1801,6 @@ impl<DB: NeighborWalkDB, NC: NeighborComms> NeighborWalk<DB, NC> {
18051801
}
18061802
StacksMessageType::Nack(ref data) => {
18071803
// evict
1808-
info!(
1809-
"Dropping neighbor {:?} Reason: will Evict message: {:?}",
1810-
nkey.public_key_hash,
1811-
message.get_message_name()
1812-
);
18131804
debug!(
18141805
"{:?}: Neighbor {:?} NACK'ed Handshake with code {:?}; will evict",
18151806
network.get_local_peer(),
@@ -1821,7 +1812,6 @@ impl<DB: NeighborWalkDB, NC: NeighborComms> NeighborWalk<DB, NC> {
18211812
}
18221813
_ => {
18231814
// 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());
18251815
debug!("{:?}: Neighbor {:?} replied an out-of-sequence message (type {}); will replace", network.get_local_peer(), &nkey, message.get_message_name());
18261816
self.comms.add_broken(network, &nkey);
18271817
continue;

stackslib/src/net/p2p.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,12 @@ impl PeerNetwork {
18221822
};
18231823

18241824
match self.can_register_peer(&neighbor_key, outbound) {
1825-
Ok(_) => {}
1825+
Ok(_) => {
1826+
info!(
1827+
"Neighbor accepted! public key: {:?} address: {:?}",
1828+
pubkey_opt, neighbor_key.addrbytes
1829+
);
1830+
}
18261831
Err(e) => {
18271832
debug!(
18281833
"{:?}: Could not register peer {:?}: {:?}",
@@ -1917,6 +1922,10 @@ impl PeerNetwork {
19171922
for (nk, pubkh) in nk_remove.into_iter() {
19181923
// remove event state
19191924
self.events.remove(&nk);
1925+
info!(
1926+
"Dropping neighbor! event id: {:?} public address: {:?} public key: {:?}",
1927+
event_id, pubkh, nk.addrbytes
1928+
);
19201929

19211930
// remove inventory state
19221931
if let Some(inv_state) = self.inv_state.as_mut() {

0 commit comments

Comments
 (0)