diff --git a/eth/p2p.nim b/eth/p2p.nim index 79e1ad8..f2ef064 100644 --- a/eth/p2p.nim +++ b/eth/p2p.nim @@ -83,7 +83,8 @@ proc listeningAddress*(node: EthereumNode): ENode = return initENode(node.keys.pubKey, node.address) proc startListening*(node: EthereumNode) = - let ta = initTAddress(node.address.ip, node.address.tcpPort) + # TODO allow binding to specific IP / IPv6 / etc + let ta = initTAddress(IPv4_any(), node.address.tcpPort) if node.listeningServer == nil: node.listeningServer = createStreamServer(ta, processIncoming, {ReuseAddr}, diff --git a/eth/p2p/discovery.nim b/eth/p2p/discovery.nim index 7df296c..d8e812a 100644 --- a/eth/p2p/discovery.nim +++ b/eth/p2p/discovery.nim @@ -257,7 +257,8 @@ proc processClient(transp: DatagramTransport, debug "Receive failed", err = getCurrentExceptionMsg() proc open*(d: DiscoveryProtocol) = - let ta = initTAddress(d.address.ip, d.address.udpPort) + # TODO allow binding to specific IP / IPv6 / etc + let ta = initTAddress(IPv4_any(), d.address.udpPort) d.transp = newDatagramTransport(processClient, udata = d, local = ta) proc lookupRandom*(d: DiscoveryProtocol): Future[seq[Node]] {.inline.} = diff --git a/eth/p2p/private/p2p_types.nim b/eth/p2p/private/p2p_types.nim index c46c0d8..a4cd381 100644 --- a/eth/p2p/private/p2p_types.nim +++ b/eth/p2p/private/p2p_types.nim @@ -14,7 +14,7 @@ type clientId*: string connectionState*: ConnectionState keys*: KeyPair - address*: Address + address*: Address # The external address that the node will be advertising peerPool*: PeerPool # Private fields: