core/state: auto-finalise state objects during copy

This commit is contained in:
Péter Szilágyi 2023-12-07 12:25:21 +02:00
parent a113497dd7
commit 24fab0d12e

View file

@ -723,6 +723,7 @@ func (s *StateDB) Copy() *StateDB {
// so we need to make sure that any side-effect the journal would have caused // so we need to make sure that any side-effect the journal would have caused
// during a commit (or similar op) is already applied to the copy. // during a commit (or similar op) is already applied to the copy.
state.stateObjects[addr] = object.deepCopy(state) state.stateObjects[addr] = object.deepCopy(state)
state.stateObjects[addr].finalise(true)
state.stateObjectsDirty[addr] = struct{}{} // Mark the copy dirty to force internal (code/state) commits state.stateObjectsDirty[addr] = struct{}{} // Mark the copy dirty to force internal (code/state) commits
state.stateObjectsPending[addr] = struct{}{} // Mark the copy pending to force external (account) commits state.stateObjectsPending[addr] = struct{}{} // Mark the copy pending to force external (account) commits