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,8 +148,10 @@ proc requestResolver[MsgType](msg: pointer, future: FutureBase) {.gcsafe.} =
|
||||||
|
|
||||||
proc linkSendFailureToReqFuture[S, R](sendFut: Future[S], resFut: Future[R]) =
|
proc linkSendFailureToReqFuture[S, R](sendFut: Future[S], resFut: Future[R]) =
|
||||||
sendFut.addCallback() do (arg: pointer):
|
sendFut.addCallback() do (arg: pointer):
|
||||||
if not sendFut.error.isNil:
|
# Avoiding potentially double future completions
|
||||||
resFut.fail(sendFut.error)
|
if not resFut.finished:
|
||||||
|
if sendFut.failed:
|
||||||
|
resFut.fail(sendFut.error)
|
||||||
|
|
||||||
proc messagePrinter[MsgType](msg: pointer): string {.gcsafe.} =
|
proc messagePrinter[MsgType](msg: pointer): string {.gcsafe.} =
|
||||||
result = ""
|
result = ""
|
||||||
|
|
Loading…
Reference in New Issue