mirror of https://github.com/status-im/nim-eth.git
Fix a future .callback usage in rlpx (#666)
This commit is contained in:
parent
c57cebfd81
commit
2c6049b126
|
@ -1175,12 +1175,14 @@ proc postHelloSteps(peer: Peer, h: DevP2P.hello) {.async.} =
|
||||||
#
|
#
|
||||||
var messageProcessingLoop = peer.dispatchMessages()
|
var messageProcessingLoop = peer.dispatchMessages()
|
||||||
|
|
||||||
messageProcessingLoop.callback = proc(p: pointer) {.gcsafe.} =
|
let cb = proc(p: pointer) {.gcsafe.} =
|
||||||
if messageProcessingLoop.failed:
|
if messageProcessingLoop.failed:
|
||||||
debug "Ending dispatchMessages loop", peer,
|
debug "Ending dispatchMessages loop", peer,
|
||||||
err = messageProcessingLoop.error.msg
|
err = messageProcessingLoop.error.msg
|
||||||
traceAsyncErrors peer.disconnect(ClientQuitting)
|
traceAsyncErrors peer.disconnect(ClientQuitting)
|
||||||
|
|
||||||
|
messageProcessingLoop.addCallback(cb)
|
||||||
|
|
||||||
# The handshake may involve multiple async steps, so we wait
|
# The handshake may involve multiple async steps, so we wait
|
||||||
# here for all of them to finish.
|
# here for all of them to finish.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue