mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
core/state: add CommitWithUpdate method
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
fc915406d6
commit
fbac246f39
1 changed files with 10 additions and 0 deletions
|
|
@ -1356,6 +1356,16 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool, noStorageWiping
|
||||||
return ret.Root, nil
|
return ret.Root, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CommitWithUpdate is similar to Commit, commits the state mutations,
|
||||||
|
// it returns the state update instead of the root hash.
|
||||||
|
func (s *StateDB) CommitWithUpdate(block uint64, deleteEmptyObjects bool, noStorageWiping bool) (*StateUpdate, error) {
|
||||||
|
ret, err := s.commitAndFlush(block, deleteEmptyObjects, noStorageWiping)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return ret, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare handles the preparatory steps for executing a state transition with.
|
// Prepare handles the preparatory steps for executing a state transition with.
|
||||||
// This method must be invoked before state transition.
|
// This method must be invoked before state transition.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue