mirror of https://github.com/status-im/nim-eth.git
Fixes #13
This commit is contained in:
parent
07a0c5443f
commit
eb1a04e93b
|
@ -738,7 +738,6 @@ macro p2pProtocolImpl(name: static[string],
|
||||||
hasReqIds = useRequestIds and msgKind in {rlpxRequest, rlpxResponse}
|
hasReqIds = useRequestIds and msgKind in {rlpxRequest, rlpxResponse}
|
||||||
|
|
||||||
var
|
var
|
||||||
paramCount = 0
|
|
||||||
userPragmas = n.pragma
|
userPragmas = n.pragma
|
||||||
|
|
||||||
# variables used in the sending procs
|
# variables used in the sending procs
|
||||||
|
@ -774,7 +773,7 @@ macro p2pProtocolImpl(name: static[string],
|
||||||
result = msgRecord
|
result = msgRecord
|
||||||
if hasReqIds:
|
if hasReqIds:
|
||||||
# Messages using request Ids
|
# Messages using request Ids
|
||||||
readParamsPrelude.add quote do:
|
readParams.add quote do:
|
||||||
let `reqId` = `read`(`receivedRlp`, int)
|
let `reqId` = `read`(`receivedRlp`, int)
|
||||||
|
|
||||||
case msgKind
|
case msgKind
|
||||||
|
@ -844,8 +843,6 @@ macro p2pProtocolImpl(name: static[string],
|
||||||
outRecvProcs.add(userHandlerProc)
|
outRecvProcs.add(userHandlerProc)
|
||||||
|
|
||||||
for param, paramType in n.typedParams(skip = 1):
|
for param, paramType in n.typedParams(skip = 1):
|
||||||
inc paramCount
|
|
||||||
|
|
||||||
# This is a fragment of the sending proc that
|
# This is a fragment of the sending proc that
|
||||||
# serializes each of the passed parameters:
|
# serializes each of the passed parameters:
|
||||||
paramsToWrite.add param
|
paramsToWrite.add param
|
||||||
|
@ -869,6 +866,8 @@ macro p2pProtocolImpl(name: static[string],
|
||||||
if userHandlerCall != nil:
|
if userHandlerCall != nil:
|
||||||
userHandlerCall.add newDotExpr(receivedMsg, param)
|
userHandlerCall.add newDotExpr(receivedMsg, param)
|
||||||
|
|
||||||
|
let paramCount = paramsToWrite.len
|
||||||
|
|
||||||
if paramCount > 1:
|
if paramCount > 1:
|
||||||
readParamsPrelude.add newCall(enterList, receivedRlp)
|
readParamsPrelude.add newCall(enterList, receivedRlp)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue