فهرست منبع

Merge pull request #2119 from karalabe/statedb-batch-commit

core/state: always commit in batches, just finish if not needed later
Jeffrey Wilcke 9 سال پیش
والد
کامیت
5945a33350
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      core/state/statedb.go

+ 2 - 1
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