Browse Source

Check StorageRoot for Zero before state.Load().

pull/37/head
Jae Kwon 9 years ago
parent
commit
af3b31db24
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      state/vm_app_state.go

+ 7
- 1
state/vm_app_state.go View File

@ -30,13 +30,19 @@ func toStateAccount(acc *vm.Account) *ac.Account {
if !ok {
pubKey = ac.PubKeyNil{}
}
var storageRoot []byte
if acc.StorageRoot.IsZero() {
storageRoot = nil
} else {
storageRoot = acc.StorageRoot.Bytes()
}
return &ac.Account{
Address: acc.Address.Address(),
PubKey: pubKey,
Balance: acc.Balance,
Code: acc.Code,
Sequence: uint(acc.Nonce),
StorageRoot: acc.StorageRoot.Bytes(),
StorageRoot: storageRoot,
}
}


Loading…
Cancel
Save