diff --git a/eth/p2p/rlpxcrypt.nim b/eth/p2p/rlpxcrypt.nim index bcd15d1..875f0fd 100644 --- a/eth/p2p/rlpxcrypt.nim +++ b/eth/p2p/rlpxcrypt.nim @@ -141,6 +141,13 @@ proc encryptMsg*(msg: openarray[byte], secrets: var SecretState): seq[byte] = header[1] = byte((msg.len shr 8) and 0xFF) header[2] = byte(msg.len and 0xFF) + # This is the [capability-id, context-id] in header-data + # While not really used, this is checked in the Parity client. + # Same as rlp.encode((0, 0)) + header[3] = 0xc2 + header[4] = 0x80 + header[5] = 0x80 + # XXX: # This would be safer if we use a thread-local sequ for the temporary buffer result = newSeq[byte](encryptedLength(msg.len))