From f213ceb83f4d915089347485721b1f99b71596f0 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 13 Jun 2019 11:51:12 +0200 Subject: [PATCH] p2p: add more info to peer addition and removal logs (#19712) --- p2p/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/server.go b/p2p/server.go index a373904fc..b7340a5ea 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -744,7 +744,7 @@ running: p.events = &srv.peerFeed } name := truncateName(c.name) - srv.log.Debug("Adding p2p peer", "name", name, "addr", c.fd.RemoteAddr(), "peers", len(peers)+1) + p.log.Debug("Adding p2p peer", "addr", p.RemoteAddr(), "peers", len(peers)+1, "name", name) go srv.runPeer(p) peers[c.node.ID()] = p if p.Inbound() { @@ -759,7 +759,7 @@ running: case pd := <-srv.delpeer: // A peer disconnected. d := common.PrettyDuration(mclock.Now() - pd.created) - pd.log.Debug("Removing p2p peer", "duration", d, "peers", len(peers)-1, "req", pd.requested, "err", pd.err) + pd.log.Debug("Removing p2p peer", "addr", pd.RemoteAddr(), "peers", len(peers)-1, "duration", d, "req", pd.requested, "err", pd.err) delete(peers, pd.ID()) if pd.Inbound() { inboundCount--