From 54e222866aab18c9bcd90c22532892e53a0da5ee Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 21 Mar 2015 13:29:01 -0700 Subject: [PATCH] Check StorageRoot for Zero before state.Load() again. Closes #36 --- state/vm_app_state.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/state/vm_app_state.go b/state/vm_app_state.go index e0cf66ea5..ad25482fb 100644 --- a/state/vm_app_state.go +++ b/state/vm_app_state.go @@ -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)