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
22ef7370
Commit
22ef7370
authored
Jun 14, 2016
by
Péter Szilágyi
Committed by
GitHub
Jun 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2686 from obscuren/issue-2542
core/state, eth: Updated suicides objects when tracing transactions
parents
a38be3eb
bb3651ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
statedb.go
core/state/statedb.go
+21
-0
api.go
eth/api.go
+1
-0
No files found.
core/state/statedb.go
View file @
22ef7370
...
...
@@ -370,6 +370,27 @@ func (s *StateDB) IntermediateRoot() common.Hash {
return
s
.
trie
.
Hash
()
}
// DeleteSuicides flags the suicided objects for deletion so that it
// won't be referenced again when called / queried up on.
//
// DeleteSuicides should not be used for consensus related updates
// under any circumstances.
func
(
s
*
StateDB
)
DeleteSuicides
()
{
// Reset refund so that any used-gas calculations can use
// this method.
s
.
refund
=
new
(
big
.
Int
)
for
_
,
stateObject
:=
range
s
.
stateObjects
{
if
stateObject
.
dirty
{
// If the object has been removed by a suicide
// flag the object as deleted.
if
stateObject
.
remove
{
stateObject
.
deleted
=
true
}
stateObject
.
dirty
=
false
}
}
}
// Commit commits all state changes to the database.
func
(
s
*
StateDB
)
Commit
()
(
root
common
.
Hash
,
err
error
)
{
root
,
batch
:=
s
.
CommitBatch
()
...
...
eth/api.go
View file @
22ef7370
...
...
@@ -1876,6 +1876,7 @@ func (api *PrivateDebugAPI) TraceTransaction(txHash common.Hash, logger *vm.LogC
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"mutation failed: %v"
,
err
)
}
stateDb
.
DeleteSuicides
()
continue
}
// Otherwise trace the transaction and return
...
...
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