Skip to content

Commit

Permalink
core/state: fix state object deep copy (#20100)
Browse files Browse the repository at this point in the history
deepCopy didn't copy pending storage updates, leading to the
creation of blocks with invalid state root.
  • Loading branch information
rjl493456442 authored and fjl committed Sep 20, 2019
1 parent 24ef835 commit 05347b3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ func (s *stateObject) deepCopy(db *StateDB) *stateObject {
stateObject.code = s.code
stateObject.dirtyStorage = s.dirtyStorage.Copy()
stateObject.originStorage = s.originStorage.Copy()
stateObject.pendingStorage = s.pendingStorage.Copy()
stateObject.suicided = s.suicided
stateObject.dirtyCode = s.dirtyCode
stateObject.deleted = s.deleted
Expand Down

0 comments on commit 05347b3

Please sign in to comment.