Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Jun 29, 2024
1 parent 12eb426 commit f0f8477
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions p2p/pex/pex_reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,8 @@ func (r *Reactor) dialAttemptsInfo(addr *p2p.NetAddress) (attempts int, lastDial

func (r *Reactor) dialPeer(addr *p2p.NetAddress) error {
err := r.Switch.DialPeerWithAddress(addr)
if err == nil {
fmt.Println("Dialing summary 2 success, addr", addr)
}
if err != nil {
attempts, lastDialed := r.dialAttemptsInfo(addr)
fmt.Println("Dialing summary 2 fail, addr, err, attempts, lastDialed: ", addr, err, attempts, lastDialed)
attempts, _ := r.dialAttemptsInfo(addr)
if _, ok := err.(p2p.ErrCurrentlyDialingOrExistingAddress); ok {
return err
}
Expand All @@ -644,7 +640,6 @@ func (r *Reactor) dialPeer(addr *p2p.NetAddress) error {
default:
newAttempts := attempts + 1
r.attemptsToDial.Store(addr.DialString(), _attemptsToDial{newAttempts, time.Now()})
fmt.Println("Updated attempts for addr: ", addr, newAttempts)
}
return fmt.Errorf("dialing failed (attempts: %d): %w", attempts+1, err)
}
Expand Down

0 comments on commit f0f8477

Please sign in to comment.