mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-26 11:11:41 +00:00
Check StorageRoot for Zero before state.Load().
This commit is contained in:
@ -30,13 +30,19 @@ func toStateAccount(acc *vm.Account) *ac.Account {
|
|||||||
if !ok {
|
if !ok {
|
||||||
pubKey = ac.PubKeyNil{}
|
pubKey = ac.PubKeyNil{}
|
||||||
}
|
}
|
||||||
|
var storageRoot []byte
|
||||||
|
if acc.StorageRoot.IsZero() {
|
||||||
|
storageRoot = nil
|
||||||
|
} else {
|
||||||
|
storageRoot = acc.StorageRoot.Bytes()
|
||||||
|
}
|
||||||
return &ac.Account{
|
return &ac.Account{
|
||||||
Address: acc.Address.Address(),
|
Address: acc.Address.Address(),
|
||||||
PubKey: pubKey,
|
PubKey: pubKey,
|
||||||
Balance: acc.Balance,
|
Balance: acc.Balance,
|
||||||
Code: acc.Code,
|
Code: acc.Code,
|
||||||
Sequence: uint(acc.Nonce),
|
Sequence: uint(acc.Nonce),
|
||||||
StorageRoot: acc.StorageRoot.Bytes(),
|
StorageRoot: storageRoot,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user