Skip to content

Commit

Permalink
fix if order
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Aug 24, 2021
1 parent c317723 commit 5cf36a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions p2p/protocol/holepunch/coordination.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ func (hs *HolePunchService) HolePunch(rp peer.ID) error {
dt := time.Since(tstart)
cancel()

if err == nil {
hs.tracer.DirectDialSuccessful(rp, dt)
log.Debugf("direct connection to peer %s successful, no need for a hole punch", rp.Pretty())
return nil
if err != nil {
hs.tracer.DirectDialFailed(rp, dt, err)
break
}
hs.tracer.DirectDialFailed(rp, dt, err)
break
hs.tracer.DirectDialSuccessful(rp, dt)
log.Debugf("direct connection to peer %s successful, no need for a hole punch", rp.Pretty())
return nil
}
}

Expand Down

0 comments on commit 5cf36a6

Please sign in to comment.