forked from cerc-io/plugeth
p2p: add more info to peer addition and removal logs (#19712)
This commit is contained in:
parent
c8c3ebd593
commit
f213ceb83f
@ -744,7 +744,7 @@ running:
|
|||||||
p.events = &srv.peerFeed
|
p.events = &srv.peerFeed
|
||||||
}
|
}
|
||||||
name := truncateName(c.name)
|
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)
|
go srv.runPeer(p)
|
||||||
peers[c.node.ID()] = p
|
peers[c.node.ID()] = p
|
||||||
if p.Inbound() {
|
if p.Inbound() {
|
||||||
@ -759,7 +759,7 @@ running:
|
|||||||
case pd := <-srv.delpeer:
|
case pd := <-srv.delpeer:
|
||||||
// A peer disconnected.
|
// A peer disconnected.
|
||||||
d := common.PrettyDuration(mclock.Now() - pd.created)
|
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())
|
delete(peers, pd.ID())
|
||||||
if pd.Inbound() {
|
if pd.Inbound() {
|
||||||
inboundCount--
|
inboundCount--
|
||||||
|
Loading…
Reference in New Issue
Block a user