Skip to content

Commit

Permalink
Merge pull request #40 from libp2p/asr/fix-error
Browse files Browse the repository at this point in the history
Fix error log
  • Loading branch information
Stebalien authored Oct 5, 2021
2 parents bbf8637 + 7201aee commit 1e31180
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p2p/net/nat/nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ func (nat *NAT) establishMapping(m *mapping) {
if err != nil || newport == 0 {
m.setExternalPort(0) // clear mapping
// TODO: log.Event
log.Warnf("failed to establish port mapping: %s", err)
if err != nil {
log.Warnf("failed to establish port mapping: %s", err)
} else {
log.Warnf("failed to establish port mapping: newport = 0")
}
// we do not close if the mapping failed,
// because it may work again next time.
return
Expand Down

0 comments on commit 1e31180

Please sign in to comment.