Skip to content

Commit

Permalink
Added log to print number of peers (#32)
Browse files Browse the repository at this point in the history
* added log to print number of peers

* update
  • Loading branch information
pratikspatil024 committed Nov 6, 2023
1 parent 5f94b7e commit 2f132b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions p2p/pex/pex_reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ func (r *PEXReactor) dialAttemptsInfo(addr *p2p.NetAddress) (attempts int, lastD
}

func (r *PEXReactor) dialPeer(addr *p2p.NetAddress) error {
if r.Switch.Peers().Size() == 0 {
r.Logger.Error("Peer Info", "numPeers", r.Switch.Peers().Size())
} else {
r.Logger.Info("Peer Info", "numPeers", r.Switch.Peers().Size())
}

attempts, lastDialed := r.dialAttemptsInfo(addr)

if attempts > maxAttemptsToDial {
Expand Down

0 comments on commit 2f132b9

Please sign in to comment.