Workaround compilation error cause by chronos newFuture changes

This commit is contained in:
Yuriy Glukhov 2019-04-10 16:57:19 +03:00
parent bc23b68c95
commit ca8519ef61
No known key found for this signature in database
GPG Key ID: 733560674BB43E6C
2 changed files with 5 additions and 5 deletions

View File

@ -61,6 +61,6 @@ proc verifyStateType(t: NimNode): NimNode =
if result.kind != nnkBracketExpr or $result[0] != "ref":
macros.error($result & " must be a ref type")
proc newFuture[T](location: var Future[T]) =
location = newFuture[T]()
proc initFuture[T](loc: var Future[T]) =
loc = newFuture[T]()

View File

@ -500,7 +500,7 @@ proc nextMsg*(peer: Peer, MsgType: type): Future[MsgType] =
if not f.isNil:
return Future[MsgType](f)
newFuture result
initFuture result
peer.awaitedMessages[wantedId] = result
# Known fatal errors are handled inside dispatchMessages.
@ -776,12 +776,12 @@ macro p2pProtocolImpl(name: static[string],
responseMsgId)
if hasReqIds:
appendParams.add quote do:
newFuture `resultIdent`
initFuture `resultIdent`
let `reqId` = `registerRequestCall`
paramsToWrite.add reqId
else:
appendParams.add quote do:
newFuture `resultIdent`
initFuture `resultIdent`
discard `registerRequestCall`
of rlpxResponse: