forked from TrueCloudLab/neoneo-go
Merge pull request #1129 from nspcc-dev/fix/payload
consensus: take payload hash based on data
This commit is contained in:
commit
8065114da6
2 changed files with 2 additions and 1 deletions
|
@ -167,6 +167,7 @@ var (
|
|||
func NewPayload(m netmode.Magic) *Payload {
|
||||
return &Payload{
|
||||
network: m,
|
||||
message: new(message),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue