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
9bc0138d
Unverified
Commit
9bc0138d
authored
Jan 23, 2019
by
Martin Holst Swende
Committed by
GitHub
Jan 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: properly flush files in standardTraceBlockToFile (#18502)
parent
85a79b3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
api_tracer.go
eth/api_tracer.go
+6
-2
No files found.
eth/api_tracer.go
View file @
9bc0138d
...
...
@@ -576,6 +576,7 @@ func (api *PrivateDebugAPI) standardTraceBlockToFile(ctx context.Context, block
vmConf
vm
.
Config
dump
*
os
.
File
writer
*
bufio
.
Writer
err
error
)
// If the transaction needs tracing, swap out the configs
...
...
@@ -590,16 +591,19 @@ func (api *PrivateDebugAPI) standardTraceBlockToFile(ctx context.Context, block
dumps
=
append
(
dumps
,
dump
.
Name
())
// Swap out the noop logger to the standard tracer
writer
=
bufio
.
NewWriter
(
dump
)
vmConf
=
vm
.
Config
{
Debug
:
true
,
Tracer
:
vm
.
NewJSONLogger
(
&
logConfig
,
bufio
.
NewWriter
(
dump
)
),
Tracer
:
vm
.
NewJSONLogger
(
&
logConfig
,
writer
),
EnablePreimageRecording
:
true
,
}
}
// Execute the transaction and flush any traces to disk
vmenv
:=
vm
.
NewEVM
(
vmctx
,
statedb
,
api
.
config
,
vmConf
)
_
,
_
,
_
,
err
=
core
.
ApplyMessage
(
vmenv
,
msg
,
new
(
core
.
GasPool
)
.
AddGas
(
msg
.
Gas
()))
if
writer
!=
nil
{
writer
.
Flush
()
}
if
dump
!=
nil
{
dump
.
Close
()
log
.
Info
(
"Wrote standard trace"
,
"file"
,
dump
.
Name
())
...
...
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