Commit 5945a333 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke

Merge pull request #2119 from karalabe/statedb-batch-commit

core/state: always commit in batches, just finish if not needed later
parents 1b8566a7 2d5d6d9d
...@@ -353,7 +353,8 @@ func (s *StateDB) IntermediateRoot() common.Hash { ...@@ -353,7 +353,8 @@ func (s *StateDB) IntermediateRoot() common.Hash {
// Commit commits all state changes to the database. // Commit commits all state changes to the database.
func (s *StateDB) Commit() (root common.Hash, err error) { func (s *StateDB) Commit() (root common.Hash, err error) {
return s.commit(s.db) root, batch := s.CommitBatch()
return root, batch.Write()
} }
// CommitBatch commits all state changes to a write batch but does not // CommitBatch commits all state changes to a write batch but does not
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment