mirror of https://github.com/status-im/nim-eth.git
Quickfix for a potential double future completion in rlpx (#538)
This commit is contained in:
parent
591360284b
commit
ba69c1ff29
|
@ -148,7 +148,9 @@ proc requestResolver[MsgType](msg: pointer, future: FutureBase) {.gcsafe.} =
|
|||
|
||||
proc linkSendFailureToReqFuture[S, R](sendFut: Future[S], resFut: Future[R]) =
|
||||
sendFut.addCallback() do (arg: pointer):
|
||||
if not sendFut.error.isNil:
|
||||
# Avoiding potentially double future completions
|
||||
if not resFut.finished:
|
||||
if sendFut.failed:
|
||||
resFut.fail(sendFut.error)
|
||||
|
||||
proc messagePrinter[MsgType](msg: pointer): string {.gcsafe.} =
|
||||
|
|
Loading…
Reference in New Issue