From 2d5d6d9d0e4dbcd03d563bdc67fa31514bdafdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 13 Jan 2016 12:04:03 +0200 Subject: [PATCH] core/state: always commit in batches, just finish if not needed later --- core/state/statedb.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 4133210577..8093472b59 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -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