p2p:add isInbound infor in log debug

This commit is contained in:
Huy Ngo 2024-06-13 17:54:05 +07:00
parent 86150af2e5
commit 54795e05e8
No known key found for this signature in database

View file

@ -778,7 +778,7 @@ running:
// The handshakes are done and it passed all checks. // The handshakes are done and it passed all checks.
p := srv.launchPeer(c) p := srv.launchPeer(c)
peers[c.node.ID()] = p peers[c.node.ID()] = p
srv.log.Debug("Adding p2p peer", "peercount", len(peers), "id", p.ID(), "conn", c.flags, "addr", p.RemoteAddr(), "name", p.Name()) srv.log.Debug("Adding p2p peer", "peercount", len(peers), "id", p.ID(), "conn", c.flags, "addr", p.RemoteAddr(), "name", p.Name(), "isInbound", p.Inbound())
srv.dialsched.peerAdded(c) srv.dialsched.peerAdded(c)
if p.Inbound() { if p.Inbound() {
inboundCount++ inboundCount++
@ -796,7 +796,7 @@ running:
// A peer disconnected. // A peer disconnected.
d := common.PrettyDuration(mclock.Now() - pd.created) d := common.PrettyDuration(mclock.Now() - pd.created)
delete(peers, pd.ID()) delete(peers, pd.ID())
srv.log.Debug("Removing p2p peer", "peercount", len(peers), "id", pd.ID(), "duration", d, "req", pd.requested, "err", pd.err) srv.log.Debug("Removing p2p peer", "peercount", len(peers), "id", pd.ID(), "duration", d, "req", pd.requested, "err", pd.err, "isInbound", pd.Inbound())
srv.dialsched.peerRemoved(pd.rw) srv.dialsched.peerRemoved(pd.rw)
if pd.Inbound() { if pd.Inbound() {
inboundCount-- inboundCount--