mirror of
https://github.com/status-im/nim-eth.git
synced 2025-01-11 14:54:33 +00:00
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}
|
||||
|
||||
var
|
||||
paramCount = 0
|
||||
userPragmas = n.pragma
|
||||
|
||||
# variables used in the sending procs
|
||||
@ -774,7 +773,7 @@ macro p2pProtocolImpl(name: static[string],
|
||||
result = msgRecord
|
||||
if hasReqIds:
|
||||
# Messages using request Ids
|
||||
readParamsPrelude.add quote do:
|
||||
readParams.add quote do:
|
||||
let `reqId` = `read`(`receivedRlp`, int)
|
||||
|
||||
case msgKind
|
||||
@ -844,8 +843,6 @@ macro p2pProtocolImpl(name: static[string],
|
||||
outRecvProcs.add(userHandlerProc)
|
||||
|
||||
for param, paramType in n.typedParams(skip = 1):
|
||||
inc paramCount
|
||||
|
||||
# This is a fragment of the sending proc that
|
||||
# serializes each of the passed parameters:
|
||||
paramsToWrite.add param
|
||||
@ -869,6 +866,8 @@ macro p2pProtocolImpl(name: static[string],
|
||||
if userHandlerCall != nil:
|
||||
userHandlerCall.add newDotExpr(receivedMsg, param)
|
||||
|
||||
let paramCount = paramsToWrite.len
|
||||
|
||||
if paramCount > 1:
|
||||
readParamsPrelude.add newCall(enterList, receivedRlp)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user