Adjust logging when node is not reachable but enrAutoUpdate is on (#436)

Separate the logging when the node is not reachable and
enrAutoUpdate is on or off to avoid confusion whether or not the
node might still become reachable.
This commit is contained in:
Kim De Mey 2021-11-29 22:13:08 +01:00 committed by GitHub
parent 2baa4c02a1
commit ae0574fe61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -911,7 +911,11 @@ proc newProtocol*(privKey: PrivateKey,
info "ENR initialized", ip = enrIp, tcp = enrTcpPort, udp = enrUdpPort,
seqNum = record.seqNum, uri = toURI(record)
if enrIp.isNone():
warn "No external IP provided for the ENR, this node will not be discoverable"
if enrAutoUpdate:
notice "No external IP provided for the ENR, this node will not be " &
"discoverable until the ENR is updated with the discovered external IP address"
else:
warn "No external IP provided for the ENR, this node will not be discoverable"
let node = newNode(record).expect("Properly initialized record")