From 120c4d44062d3038c0ec07cba4475c234db5ba69 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 4 Sep 2020 16:08:53 +0300 Subject: [PATCH] network: don't compress Inventory messages They're not really compressable. --- pkg/network/message.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/network/message.go b/pkg/network/message.go index bb9d86f3f..368d69cc9 100644 --- a/pkg/network/message.go +++ b/pkg/network/message.go @@ -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)