[skip ci] remove an obsolete comment

This commit is contained in:
Zahary Karadjov 2020-02-20 10:09:30 +02:00 committed by zah
parent 5742299c94
commit 9e58e22761
2 changed files with 4 additions and 9 deletions

View File

@ -188,10 +188,14 @@ proc dialPeer*(node: Eth2Node, peerInfo: PeerInfo) {.async.} =
discard await node.switch.dial(peerInfo)
var peer = node.getPeer(peerInfo)
peer.wasDialed = true
debug "Initializing connection"
await initializeConnection(peer)
# TODO: This should happen automatically in the future in nim-libp2p
debug "Subscribing to pubsub"
await peer.network.switch.subscribeToPeer(peer.info)
inc libp2p_successful_dials
debug "Network handshakes completed"

View File

@ -156,15 +156,6 @@ proc handleInitialStatus(peer: Peer,
state: BeaconSyncNetworkState,
ourStatus: StatusMsg,
theirStatus: StatusMsg) {.async, gcsafe.} =
when networkBackend == libp2p:
# TODO: This doesn't seem like an appropraite place for this call,
# but it's hard to pick a better place at the moment.
# nim-libp2p plans to add a general `onPeerConnected` callback which
# will allow us to implement the subscription earlier.
# The root of the problem is that both sides must call `subscribeToPeer`
# before any GossipSub traffic will flow between them.
discard
if theirStatus.forkVersion != state.forkVersion:
notice "Irrelevant peer",
peer, theirFork = theirStatus.forkVersion, ourFork = state.forkVersion