diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index 84a499db5..f54204ba4 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -499,7 +499,7 @@ proc sendErrorResponse(peer: Peer, peer, responseCode, errMsg = formatErrorMsg(errMsg) conn.writeChunk(some responseCode, SSZ.encode(errMsg)) -proc sendNotificationMsg(peer: Peer, protocolId: string, requestBytes: Bytes) {.async} = +proc sendNotificationMsg(peer: Peer, protocolId: string, requestBytes: Bytes) {.async.} = var deadline = sleepAsync RESP_TIMEOUT streamFut = peer.network.openStream(peer, protocolId) @@ -507,7 +507,7 @@ proc sendNotificationMsg(peer: Peer, protocolId: string, requestBytes: Bytes) {. await streamFut or deadline if not streamFut.finished: - streamFut.cancel() + await streamFut.cancelAndWait() raise newException(TransmissionError, "Failed to open LibP2P stream") let stream = streamFut.read diff --git a/vendor/nim-eth b/vendor/nim-eth index bc8a8947f..114680453 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit bc8a8947fc146cfb0765f407528669932e604d8a +Subproject commit 114680453f789f947a3c057bbeb5bdf593f5364b diff --git a/vendor/nim-libp2p b/vendor/nim-libp2p index 3956f3fd6..74acd0a33 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit 3956f3fd6930ee46047e7fc3dd370b203c4c4ff8 +Subproject commit 74acd0a33ac6e77463094034a2433a379e3b9add