Skip to content

Commit 13bead5

Browse files
committed
Use toPort helper + nph
1 parent 05141b7 commit 13bead5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

portal/client/nimbus_portal_client.nim

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,12 @@ proc run(portalClient: PortalClient, config: PortalConf) {.raises: [CatchableErr
106106
bindIp = config.listenAddress
107107
udpPort = Port(config.udpPort)
108108
(extIp, extPorts) = setupAddress(
109-
config.nat, config.listenAddress, @[(port: udpPort, protocol: PortProtocol.UDP)], "nimbus_portal_client"
109+
config.nat,
110+
config.listenAddress,
111+
@[(port: udpPort, protocol: PortProtocol.UDP)],
112+
"nimbus_portal_client",
110113
)
111-
extUdpPort =
112-
if isSome(extPorts[0]):
113-
Opt.some(extPorts[0].value().port)
114-
else:
115-
Opt.none(Port)
114+
extUdpPort = extPorts[0].toPort()
116115
(netkey, newNetKey) =
117116
if config.networkKey.isSome():
118117
(config.networkKey.get(), true)

0 commit comments

Comments
 (0)