mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
p2p/nat: fix external port logging
Was logging 0 instead of original port. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
ca79cd0b46
commit
f0e03a7842
1 changed files with 3 additions and 5 deletions
|
|
@ -150,11 +150,9 @@ func (srv *Server) portMappingLoop() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
external := m.extPort
|
log := newLogger(m.protocol, m.extPort, m.port)
|
||||||
log := newLogger(m.protocol, external, m.port)
|
|
||||||
|
|
||||||
log.Trace("Attempting port mapping")
|
log.Trace("Attempting port mapping")
|
||||||
p, err := srv.NAT.AddMapping(m.protocol, external, m.port, m.name, portMapDuration)
|
p, err := srv.NAT.AddMapping(m.protocol, m.extPort, m.port, m.name, portMapDuration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug("Couldn't add port mapping", "err", err)
|
log.Debug("Couldn't add port mapping", "err", err)
|
||||||
m.extPort = 0
|
m.extPort = 0
|
||||||
|
|
@ -164,8 +162,8 @@ func (srv *Server) portMappingLoop() {
|
||||||
// It was mapped!
|
// It was mapped!
|
||||||
m.extPort = int(p)
|
m.extPort = int(p)
|
||||||
m.nextTime = srv.clock.Now().Add(portMapRefreshInterval)
|
m.nextTime = srv.clock.Now().Add(portMapRefreshInterval)
|
||||||
if m.port != m.extPort {
|
|
||||||
log = newLogger(m.protocol, m.extPort, m.port)
|
log = newLogger(m.protocol, m.extPort, m.port)
|
||||||
|
if m.port != m.extPort {
|
||||||
log.Info("NAT mapped alternative port")
|
log.Info("NAT mapped alternative port")
|
||||||
} else {
|
} else {
|
||||||
log.Info("NAT mapped port")
|
log.Info("NAT mapped port")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue