diff --git a/nimbus/sync/protocol/les_protocol.nim b/nimbus/sync/protocol/les_protocol.nim index 236bc2e39..8eb914e2e 100644 --- a/nimbus/sync/protocol/les_protocol.nim +++ b/nimbus/sync/protocol/les_protocol.nim @@ -167,16 +167,19 @@ macro outgoingRequestDecorator(n: untyped): untyped = trackOutgoingRequest(peer.networkState(les), peer.state(les), perProtocolMsgId, reqId, `costQuantity`) - # echo result.repr + #echo "outgoingRequestDecorator: ", result.repr macro incomingResponseDecorator(n: untyped): untyped = result = n let trackingCall = quote do: - trackIncomingResponse(peer.state(les), reqId, msg.bufValue) + try: + trackIncomingResponse(peer.state(les), reqId, msg.bufValue) + except KeyError as exc: + raise newException(EthP2PError, exc.msg) result.body.insert(n.body.len - 1, trackingCall) - # echo result.repr + #echo "incomingResponseDecorator: ", result.repr macro incomingRequestDecorator(n: untyped): untyped = result = n @@ -195,8 +198,9 @@ macro incomingRequestDecorator(n: untyped): untyped = perProtocolMsgId, requestCostQuantity): return - result.body.insert(1, getAst(acceptStep(costQuantity, maxQuantity))) - # echo result.repr + let zero = result.body[0][0] + zero.insert(1, getAst(acceptStep(costQuantity, maxQuantity))) + #echo "incomingRequestDecorator: ", result.repr template updateBV: BufValueInt = bufValueAfterRequest(lesNetwork, lesPeer, diff --git a/vendor/nim-eth b/vendor/nim-eth index efe610e27..d8209f623 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit efe610e27f09435b0898b33e9357bc52fe04f52c +Subproject commit d8209f623f837d14c43a9e3fd464b0e199c5d180