Skip to content

Commit

Permalink
Merge PR:fix invalid state set when the value is zero (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiD authored May 26, 2021
1 parent 77305ed commit 55bd718
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/evm/types/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ func (so *stateObject) commitState() {
// delete empty values from the store
if (state.Value == ethcmn.Hash{}) {
store.Delete(state.Key.Bytes())
if !so.stateDB.ctx.IsCheckTx() {
if so.stateDB.Watcher.Enabled() {
so.stateDB.Watcher.SaveState(so.Address(), state.Key.Bytes(), ethcmn.Hash{}.Bytes())
}
}
}

delete(so.keyToDirtyStorageIndex, state.Key)
Expand Down

0 comments on commit 55bd718

Please sign in to comment.