network: provide NullPayload where necessary

This commit is contained in:
Evgenii Stratonikov 2020-12-23 15:32:16 +03:00
parent 0a5049658f
commit 2cb536a6a1
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -474,7 +474,7 @@ func (s *Server) handleVersionCmd(p Peer, version *payload.Version) error {
} }
} }
s.lock.RUnlock() 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. // handleBlockCmd processes the received block received from its peer.