diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 07a9d822b..444548974 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -167,6 +167,7 @@ var ( func NewPayload(m netmode.Magic) *Payload { return &Payload{ network: m, + message: new(message), } } diff --git a/pkg/consensus/payload.go b/pkg/consensus/payload.go index 31cbaec88..80f56f0f7 100644 --- a/pkg/consensus/payload.go +++ b/pkg/consensus/payload.go @@ -171,7 +171,7 @@ func (p *Payload) EncodeBinaryUnsigned(w *io.BinWriter) { w.WriteU32LE(p.height) w.WriteU16LE(p.validatorIndex) - if p.message != nil { + if p.data == nil { ww := io.NewBufBinWriter() p.message.EncodeBinary(ww.BinWriter) p.data = ww.Bytes()