From 2cb536a6a158c1a426ef5297b140f942aa29732c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 23 Dec 2020 15:32:16 +0300 Subject: [PATCH] network: provide NullPayload where necessary --- pkg/network/message.go | 2 +- pkg/network/server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/network/message.go b/pkg/network/message.go index 3b73a5422..c8bf606ae 100644 --- a/pkg/network/message.go +++ b/pkg/network/message.go @@ -216,7 +216,7 @@ 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: diff --git a/pkg/network/server.go b/pkg/network/server.go index e4721f1e0..caf464b56 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -474,7 +474,7 @@ func (s *Server) handleVersionCmd(p Peer, version *payload.Version) error { } } s.lock.RUnlock() - return p.SendVersionAck(NewMessage(CMDVerack, nil)) + return p.SendVersionAck(NewMessage(CMDVerack, payload.NewNullPayload())) } // handleBlockCmd processes the received block received from its peer.