mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
block: precompute ConsensusData hash on UnmarshalJSON
That's what we usually do for block or transaction hashes.
This commit is contained in:
parent
dfc7a9bfd1
commit
6853470603
1 changed files with 3 additions and 0 deletions
|
@ -227,5 +227,8 @@ func (b *Block) UnmarshalJSON(data []byte) error {
|
|||
b.Base = *base
|
||||
b.Transactions = auxb.Transactions
|
||||
b.ConsensusData = auxb.ConsensusData
|
||||
// Some tests rely on hash presence and we're usually precomputing
|
||||
// other hashes upon deserialization.
|
||||
_ = b.ConsensusData.Hash()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue