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
015fde9a
Unverified
Commit
015fde9a
authored
Jan 25, 2022
by
Martin Holst Swende
Committed by
GitHub
Jan 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/tracers: avoid using blockCtx concurrently (#24286)
parent
29cb5dee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
api.go
eth/tracers/api.go
+2
-1
No files found.
eth/tracers/api.go
View file @
015fde9a
...
@@ -592,11 +592,11 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
...
@@ -592,11 +592,11 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
if
threads
>
len
(
txs
)
{
if
threads
>
len
(
txs
)
{
threads
=
len
(
txs
)
threads
=
len
(
txs
)
}
}
blockCtx
:=
core
.
NewEVMBlockContext
(
block
.
Header
(),
api
.
chainContext
(
ctx
),
nil
)
blockHash
:=
block
.
Hash
()
blockHash
:=
block
.
Hash
()
for
th
:=
0
;
th
<
threads
;
th
++
{
for
th
:=
0
;
th
<
threads
;
th
++
{
pend
.
Add
(
1
)
pend
.
Add
(
1
)
go
func
()
{
go
func
()
{
blockCtx
:=
core
.
NewEVMBlockContext
(
block
.
Header
(),
api
.
chainContext
(
ctx
),
nil
)
defer
pend
.
Done
()
defer
pend
.
Done
()
// Fetch and execute the next transaction trace tasks
// Fetch and execute the next transaction trace tasks
for
task
:=
range
jobs
{
for
task
:=
range
jobs
{
...
@@ -617,6 +617,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
...
@@ -617,6 +617,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
}
}
// Feed the transactions into the tracers and return
// Feed the transactions into the tracers and return
var
failed
error
var
failed
error
blockCtx
:=
core
.
NewEVMBlockContext
(
block
.
Header
(),
api
.
chainContext
(
ctx
),
nil
)
for
i
,
tx
:=
range
txs
{
for
i
,
tx
:=
range
txs
{
// Send the trace task over for execution
// Send the trace task over for execution
jobs
<-
&
txTraceTask
{
statedb
:
statedb
.
Copy
(),
index
:
i
}
jobs
<-
&
txTraceTask
{
statedb
:
statedb
.
Copy
(),
index
:
i
}
...
...
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