mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-30 09:33:36 +00:00
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 {
|
func NewPayload(m netmode.Magic) *Payload {
|
||||||
return &Payload{
|
return &Payload{
|
||||||
network: m,
|
network: m,
|
||||||
|
message: new(message),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ func (p *Payload) EncodeBinaryUnsigned(w *io.BinWriter) {
|
||||||
w.WriteU32LE(p.height)
|
w.WriteU32LE(p.height)
|
||||||
w.WriteU16LE(p.validatorIndex)
|
w.WriteU16LE(p.validatorIndex)
|
||||||
|
|
||||||
if p.message != nil {
|
if p.data == nil {
|
||||||
ww := io.NewBufBinWriter()
|
ww := io.NewBufBinWriter()
|
||||||
p.message.EncodeBinary(ww.BinWriter)
|
p.message.EncodeBinary(ww.BinWriter)
|
||||||
p.data = ww.Bytes()
|
p.data = ww.Bytes()
|
||||||
|
|
Loading…
Reference in a new issue