aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-03-23 23:36:38 +0800
committerGitHub <noreply@github.com>2017-03-23 23:36:38 +0800
commit8771c3061f340451d0966adcc547338a25f2231f (patch)
treec566cab81cf95a39f85fbe2c98a932af9495eb68 /core/state
parent11e7a712f469fb24ddb88ecebcefab6ed8880eb8 (diff)
parent37dd9086ec491900311fc39837f4a62ef5fd3a4a (diff)
downloaddexon-8771c3061f340451d0966adcc547338a25f2231f.tar
dexon-8771c3061f340451d0966adcc547338a25f2231f.tar.gz
dexon-8771c3061f340451d0966adcc547338a25f2231f.tar.bz2
dexon-8771c3061f340451d0966adcc547338a25f2231f.tar.lz
dexon-8771c3061f340451d0966adcc547338a25f2231f.tar.xz
dexon-8771c3061f340451d0966adcc547338a25f2231f.tar.zst
dexon-8771c3061f340451d0966adcc547338a25f2231f.zip
Merge pull request #3794 from fjl/core-genesis-refactor
core: refactor genesis handling
Diffstat (limited to 'core/state')
-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.