Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0f4b75be
Commit
0f4b75be
authored
Mar 07, 2017
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state: expose CommitTo
parent
d42a56af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
statedb.go
core/state/statedb.go
+3
-2
No files found.
core/state/statedb.go
View file @
0f4b75be
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment