diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-01-14 19:17:59 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-01-14 19:17:59 +0800 |
commit | 5945a33350ea6e8bfc6308826efe16aab0e2e93d (patch) | |
tree | 35588f198a3f0b9d9216421a34ed6a862d3efe3f | |
parent | 1b8566a7b137d68c5c7c42d6300378d7ebf21c49 (diff) | |
parent | 2d5d6d9d0e4dbcd03d563bdc67fa31514bdafdac (diff) | |
download | dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.tar dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.tar.gz dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.tar.bz2 dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.tar.lz dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.tar.xz dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.tar.zst dexon-5945a33350ea6e8bfc6308826efe16aab0e2e93d.zip |
Merge pull request #2119 from karalabe/statedb-batch-commit
core/state: always commit in batches, just finish if not needed later
-rw-r--r-- | core/state/statedb.go | 3 |
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 |