aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-01-13 18:04:03 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-01-13 18:04:03 +0800
commit2d5d6d9d0e4dbcd03d563bdc67fa31514bdafdac (patch)
tree35588f198a3f0b9d9216421a34ed6a862d3efe3f
parent1b8566a7b137d68c5c7c42d6300378d7ebf21c49 (diff)
downloadgo-tangerine-2d5d6d9d0e4dbcd03d563bdc67fa31514bdafdac.tar.gz
go-tangerine-2d5d6d9d0e4dbcd03d563bdc67fa31514bdafdac.tar.zst
go-tangerine-2d5d6d9d0e4dbcd03d563bdc67fa31514bdafdac.zip
core/state: always commit in batches, just finish if not needed later
-rw-r--r--core/state/statedb.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 413321057..8093472b5 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