mirror of https://github.com/status-im/nim-eth.git
Remove the unnecessary initFuture in the LibP2P p2pProtocol back-end
This commit is contained in:
parent
6513cd9eff
commit
bac6248301
|
@ -532,6 +532,9 @@ proc setBody*(sendProc: SendProc, body: NimNode) =
|
||||||
|
|
||||||
proc writeParamsAsRecord*(params: openarray[NimNode],
|
proc writeParamsAsRecord*(params: openarray[NimNode],
|
||||||
outputStream, Format, RecordType: NimNode): NimNode =
|
outputStream, Format, RecordType: NimNode): NimNode =
|
||||||
|
if params.len == 0:
|
||||||
|
return newStmtList()
|
||||||
|
|
||||||
var
|
var
|
||||||
appendParams = newStmtList()
|
appendParams = newStmtList()
|
||||||
recordWriterCtx = ident "recordWriterCtx"
|
recordWriterCtx = ident "recordWriterCtx"
|
||||||
|
@ -568,7 +571,6 @@ proc useStandardBody*(sendProc: SendProc,
|
||||||
outputStream = ident "outputStream"
|
outputStream = ident "outputStream"
|
||||||
msgBytes = ident "msgBytes"
|
msgBytes = ident "msgBytes"
|
||||||
|
|
||||||
initFuture = bindSym "initFuture"
|
|
||||||
recipient = sendProc.peerParam
|
recipient = sendProc.peerParam
|
||||||
msgRecName = msg.recName
|
msgRecName = msg.recName
|
||||||
Format = msg.protocol.backend.SerializationFormat
|
Format = msg.protocol.backend.SerializationFormat
|
||||||
|
@ -584,9 +586,6 @@ proc useStandardBody*(sendProc: SendProc,
|
||||||
|
|
||||||
appendParams = newStmtList()
|
appendParams = newStmtList()
|
||||||
|
|
||||||
initResultFuture = if msg.kind != msgRequest: newStmtList()
|
|
||||||
else: newCall(initFuture, resultIdent)
|
|
||||||
|
|
||||||
sendCall = sendCallGenerator(recipient, msgBytes)
|
sendCall = sendCallGenerator(recipient, msgBytes)
|
||||||
|
|
||||||
tracing = when not tracingEnabled:
|
tracing = when not tracingEnabled:
|
||||||
|
@ -600,7 +599,6 @@ proc useStandardBody*(sendProc: SendProc,
|
||||||
sendProc.setBody quote do:
|
sendProc.setBody quote do:
|
||||||
mixin init, WriterType, beginRecord, endRecord, getOutput
|
mixin init, WriterType, beginRecord, endRecord, getOutput
|
||||||
|
|
||||||
`initResultFuture`
|
|
||||||
var `outputStream` = memoryOutput()
|
var `outputStream` = memoryOutput()
|
||||||
`preSerialization`
|
`preSerialization`
|
||||||
`serilization`
|
`serilization`
|
||||||
|
|
Loading…
Reference in New Issue