core/state: always commit in batches, just finish if not needed later

This commit is contained in:
Péter Szilágyi 2016-01-13 12:04:03 +02:00
parent 1b8566a7b1
commit 2d5d6d9d0e
1 changed files with 2 additions and 1 deletions

View File

@ -353,7 +353,8 @@ func (s *StateDB) IntermediateRoot() common.Hash {
// Commit commits all state changes to the database.
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