Check StorageRoot for Zero before state.Load() again. Closes #36

This commit is contained in:
Ethan Buchman 2015-03-21 13:29:01 -07:00
parent af3b31db24
commit 54e222866a
1 changed files with 7 additions and 2 deletions

View File

@ -229,8 +229,13 @@ func (vas *VMAppState) Sync() {
if deleted {
continue
}
storageRoot := currentAccount.StorageRoot
storage.Load(storageRoot.Bytes())
var storageRoot []byte
if currentAccount.StorageRoot.IsZero() {
storageRoot = nil
} else {
storageRoot = currentAccount.StorageRoot.Bytes()
}
storage.Load(storageRoot)
}
if value.IsZero() {
_, removed := storage.Remove(key)