Set wasDialed.

Add more logging information.
This commit is contained in:
cheatfate 2019-11-06 16:16:31 +02:00
parent a0fbf5464a
commit f79f9deeb3
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
2 changed files with 2 additions and 2 deletions

View File

@ -485,6 +485,7 @@ proc backendLoop*(node: Eth2Node) {.async.} =
var peerCheck = node.peers.getOrDefault(item.peer) var peerCheck = node.peers.getOrDefault(item.peer)
if isNil(peerCheck): if isNil(peerCheck):
var peer = node.getPeer(item.peer) var peer = node.getPeer(item.peer)
peer.wasDialed = true
info "Handshaking with new peer", peer = item.peer.pretty(), info "Handshaking with new peer", peer = item.peer.pretty(),
addresses = item.addresses addresses = item.addresses
let fut = initializeConnection(peer) let fut = initializeConnection(peer)

View File

@ -106,7 +106,7 @@ p2pProtocol BeaconSync(version = 1,
if theirStatus.isSome: if theirStatus.isSome:
await peer.handleInitialStatus(node, ourStatus, theirStatus.get) await peer.handleInitialStatus(node, ourStatus, theirStatus.get)
else: else:
warn "Status response not received in time" warn "Status response not received in time", peer = peer.id.pretty()
onPeerDisconnected do (peer: Peer): onPeerDisconnected do (peer: Peer):
libp2p_peers.set peer.network.peers.len.int64 libp2p_peers.set peer.network.peers.len.int64
@ -234,4 +234,3 @@ proc handleInitialStatus(peer: Peer,
except CatchableError: except CatchableError:
warn "Failed to sync with peer", peer, err = getCurrentExceptionMsg() warn "Failed to sync with peer", peer, err = getCurrentExceptionMsg()