Remove some warnings

This commit is contained in:
Zahary Karadjov 2020-03-17 01:50:08 +02:00 committed by zah
parent 5a2a52869e
commit 19847bbd20
3 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ proc new*(T: type Eth2DiscoveryProtocol,
pk = initPrivateKey(rawPrivKeyBytes) pk = initPrivateKey(rawPrivKeyBytes)
db = DiscoveryDB.init(newMemoryDB()) db = DiscoveryDB.init(newMemoryDB())
newProtocol(pk, db, ip, Port conf.tcpPort, Port conf.udpPort) newProtocol(pk, db, ip, conf.tcpPort, conf.udpPort)
proc toENode*(a: MultiAddress): Result[ENode, cstring] = proc toENode*(a: MultiAddress): Result[ENode, cstring] =
if not IPFS.match(a): if not IPFS.match(a):

View File

@ -141,7 +141,7 @@ when networkBackend in [libp2p, libp2pDaemon]:
bootstrapNodes: seq[ENode]): Future[Eth2Node] {.async.} = bootstrapNodes: seq[ENode]): Future[Eth2Node] {.async.} =
var var
(extIp, extTcpPort, _) = setupNat(conf) (extIp, extTcpPort, _) = setupNat(conf)
hostAddress = tcpEndPoint(globalListeningAddr, Port conf.tcpPort) hostAddress = tcpEndPoint(globalListeningAddr, conf.tcpPort)
announcedAddresses = if extIp == globalListeningAddr: @[] announcedAddresses = if extIp == globalListeningAddr: @[]
else: @[tcpEndPoint(extIp, extTcpPort)] else: @[tcpEndPoint(extIp, extTcpPort)]

View File

@ -4,7 +4,7 @@ type
libp2pDaemon libp2pDaemon
const const
NETWORK_TYPE {.strdefine.} = "libp2p_daemon" NETWORK_TYPE {.strdefine.} = "libp2p"
networkBackend* = when NETWORK_TYPE == "libp2p": libp2p networkBackend* = when NETWORK_TYPE == "libp2p": libp2p
elif NETWORK_TYPE == "libp2p_daemon": libp2pDaemon elif NETWORK_TYPE == "libp2p_daemon": libp2pDaemon