Browse Source

Fix error log

merge-nat
Aayush Rajasekaran 3 years ago
parent
commit
7201aee2f8
  1. 6
      p2p/net/nat/nat.go

6
p2p/net/nat/nat.go

@ -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

Loading…
Cancel
Save