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
3f649d48
Unverified
Commit
3f649d48
authored
Jun 02, 2020
by
chenglin
Committed by
GitHub
Jun 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: collect NewTxsEvent items without holding reorg lock (#21145)
parent
5f6f5e34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
tx_pool.go
core/tx_pool.go
+8
-7
No files found.
core/tx_pool.go
View file @
3f649d48
...
@@ -1040,13 +1040,7 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt
...
@@ -1040,13 +1040,7 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt
}
}
// Check for pending transactions for every account that sent new ones
// Check for pending transactions for every account that sent new ones
promoted
:=
pool
.
promoteExecutables
(
promoteAddrs
)
promoted
:=
pool
.
promoteExecutables
(
promoteAddrs
)
for
_
,
tx
:=
range
promoted
{
addr
,
_
:=
types
.
Sender
(
pool
.
signer
,
tx
)
if
_
,
ok
:=
events
[
addr
];
!
ok
{
events
[
addr
]
=
newTxSortedMap
()
}
events
[
addr
]
.
Put
(
tx
)
}
// If a new block appeared, validate the pool of pending transactions. This will
// If a new block appeared, validate the pool of pending transactions. This will
// remove any transaction that has been included in the block or was invalidated
// remove any transaction that has been included in the block or was invalidated
// because of another transaction (e.g. higher gas price).
// because of another transaction (e.g. higher gas price).
...
@@ -1065,6 +1059,13 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt
...
@@ -1065,6 +1059,13 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt
pool
.
mu
.
Unlock
()
pool
.
mu
.
Unlock
()
// Notify subsystems for newly added transactions
// Notify subsystems for newly added transactions
for
_
,
tx
:=
range
promoted
{
addr
,
_
:=
types
.
Sender
(
pool
.
signer
,
tx
)
if
_
,
ok
:=
events
[
addr
];
!
ok
{
events
[
addr
]
=
newTxSortedMap
()
}
events
[
addr
]
.
Put
(
tx
)
}
if
len
(
events
)
>
0
{
if
len
(
events
)
>
0
{
var
txs
[]
*
types
.
Transaction
var
txs
[]
*
types
.
Transaction
for
_
,
set
:=
range
events
{
for
_
,
set
:=
range
events
{
...
...
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