Protocol: Fixes in Transfer code. Add IsLast convenience functions.

This commit is contained in:
Kleissner
2021-10-22 06:23:56 +02:00
parent 89f9e3a563
commit 0c4562e1d3
2 changed files with 24 additions and 14 deletions

View File

@@ -435,3 +435,8 @@ func encodePeerRecord(raw []byte, peer *PeerRecord, reason uint8) {
binary.LittleEndian.PutUint16(raw[61:61+2], peer.IPv6PortReportedInternal)
binary.LittleEndian.PutUint16(raw[63:63+2], peer.IPv6PortReportedExternal)
}
// IsLast checks if the incoming message is the last expected response in this sequence.
func (msg *MessageResponse) IsLast() bool {
return msg.Actions&(1<<ActionSequenceLast) > 0
}