cosmetics changes
This commit is contained in:
parent
f590bf0154
commit
21105f1558
|
@ -19,7 +19,7 @@ requires "nim > 0.18.0",
|
|||
"asyncdispatch2",
|
||||
"eth_common",
|
||||
"package_visible_types",
|
||||
"https://github.com/jangko/snappy"
|
||||
"snappy"
|
||||
|
||||
proc runTest(name: string, defs = "", lang = "c") =
|
||||
exec "nim " & lang & " " & defs & " -d:testing --experimental:ForLoopMacros -r tests/" & name
|
||||
|
|
|
@ -423,15 +423,12 @@ proc recvMsg*(peer: Peer): Future[tuple[msgId: int, msgData: Rlp]] {.async.} =
|
|||
decryptedBytes.setLen(decryptedBytesCount)
|
||||
|
||||
when defined(useSnappy):
|
||||
var rlp: Rlp
|
||||
if peer.network.protocolVersion == devp2pSnappyVersion:
|
||||
decryptedBytes = snappy.uncompress(decryptedBytes)
|
||||
if decryptedBytes.len == 0:
|
||||
await peer.disconnectAndRaise(BreachOfProtocol,
|
||||
"Snappy uncompress encountered malformed data")
|
||||
rlp = rlpFromBytes(decryptedBytes.toRange)
|
||||
else:
|
||||
var rlp = rlpFromBytes(decryptedBytes.toRange)
|
||||
var rlp = rlpFromBytes(decryptedBytes.toRange)
|
||||
|
||||
try:
|
||||
let msgid = rlp.read(int)
|
||||
|
|
Loading…
Reference in New Issue