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