mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-20 03:47:50 +01:00
Proper message sequence implementation for Response and Pong messages. Record round-trip time at connection level! Reply timeout. Close #13 #5
Fixes.
This commit is contained in:
@@ -99,7 +99,7 @@ func PacketEncrypt(senderPrivateKey *btcec.PrivateKey, receiverPublicKey *btcec.
|
||||
raw[4] = packet.Protocol
|
||||
raw[5] = packet.Command
|
||||
|
||||
binary.LittleEndian.PutUint16(raw[6:10], uint16(packet.Sequence))
|
||||
binary.LittleEndian.PutUint32(raw[6:10], uint32(packet.Sequence))
|
||||
binary.LittleEndian.PutUint16(raw[10:12], uint16(len(packet.Payload)))
|
||||
copy(raw[12:], packet.Payload)
|
||||
copy(raw[12+len(packet.Payload):12+len(packet.Payload)+len(garbage)], garbage)
|
||||
|
||||
Reference in New Issue
Block a user