aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-03-08 06:20:21 +0800
committerFelix Lange <fjl@twurst.com>2017-03-23 22:58:42 +0800
commit0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df (patch)
treefb71d3fac4cb621db2278064dd918e9169cfe4da /core
parentd42a56afc53cf1d12dc1b9089f0ddce2c9155d72 (diff)
downloaddexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.tar
dexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.tar.gz
dexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.tar.bz2
dexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.tar.lz
dexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.tar.xz
dexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.tar.zst
dexon-0f4b75bea27b1c39f1dd5c42c3ef472b98f4a7df.zip
core/state: expose CommitTo
Diffstat (limited to 'core')
-rw-r--r--core/state/statedb.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index cfd033bd8..0c72fc6b0 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -611,7 +611,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error)
// the root hash stored in a block.
func (s *StateDB) CommitBatch(deleteEmptyObjects bool) (root common.Hash, batch ethdb.Batch) {
batch = s.db.NewBatch()
- root, _ = s.commit(batch, deleteEmptyObjects)
+ root, _ = s.CommitTo(batch, deleteEmptyObjects)
log.Debug("Trie cache stats after commit", "misses", trie.CacheMisses(), "unloads", trie.CacheUnloads())
return root, batch
@@ -623,7 +623,8 @@ func (s *StateDB) clearJournalAndRefund() {
s.refund = new(big.Int)
}
-func (s *StateDB) commit(dbw trie.DatabaseWriter, deleteEmptyObjects bool) (root common.Hash, err error) {
+// CommitTo writes the state to the given database.
+func (s *StateDB) CommitTo(dbw trie.DatabaseWriter, deleteEmptyObjects bool) (root common.Hash, err error) {
defer s.clearJournalAndRefund()
// Commit objects to the trie.