From 2f68ee0ffe5ceb4779351ca8d26c33fdb48dc7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Mon, 13 Jan 2020 20:26:19 +0100 Subject: [PATCH] new libp2p API --- beacon_chain/libp2p_backend.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_chain/libp2p_backend.nim b/beacon_chain/libp2p_backend.nim index e67c9a602..4a93cfb3d 100644 --- a/beacon_chain/libp2p_backend.nim +++ b/beacon_chain/libp2p_backend.nim @@ -105,8 +105,8 @@ template openStream(node: Eth2Node, peer: Peer, protocolId: string): untyped = dial(node.switch, peer.info, protocolId) proc peer(stream: P2PStream): PeerID = - # TODO: Can this be `none`? - stream.peerInfo.get.peerId + # TODO: Can this be `nil`? + stream.peerInfo.peerId # # End of compatibility layer @@ -120,8 +120,8 @@ proc getPeer*(node: Eth2Node, peerInfo: PeerInfo): Peer {.gcsafe.} = node.peers[peerId] = result proc peerFromStream(network: Eth2Node, stream: P2PStream): Peer {.gcsafe.} = - # TODO: Can this be `none`? - return network.getPeer(stream.peerInfo.get) + # TODO: Can this be `nil`? + return network.getPeer(stream.peerInfo) proc disconnect*(peer: Peer, reason: DisconnectionReason, notifyOtherPeer = false) {.async.} = # TODO: How should we notify the other peer?