network: don't compress Inventory messages

They're not really compressable.
This commit is contained in:
Roman Khimov 2020-09-04 16:08:53 +03:00
parent 9c5ef8d234
commit 120c4d4406

View file

@ -213,7 +213,8 @@ func (m *Message) tryCompressPayload() error {
compressedPayload := buf.Bytes()
if m.Flags&Compressed == 0 {
switch m.Payload.(type) {
case *payload.Headers, *payload.MerkleBlock, *payload.NullPayload:
case *payload.Headers, *payload.MerkleBlock, *payload.NullPayload,
*payload.Inventory:
break
default:
size := len(compressedPayload)