p2p/nat: delete port mapping before adding (#15222)

Fixes #1024
pull/15259/head
Darrel Herbst 7 years ago committed by Felix Lange
parent 5df0b240ae
commit d54e3539d4
  1. 1
      p2p/nat/natupnp.go

@ -62,6 +62,7 @@ func (n *upnp) AddMapping(protocol string, extport, intport int, desc string, li
}
protocol = strings.ToUpper(protocol)
lifetimeS := uint32(lifetime / time.Second)
n.DeleteMapping(protocol, extport, intport)
return n.client.AddPortMapping("", uint16(extport), protocol, uint16(intport), ip.String(), true, desc, lifetimeS)
}

Loading…
Cancel
Save