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
9702badd
Unverified
Commit
9702badd
authored
May 31, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: don't uselessly recheck transactions on dump
parent
067dc2cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
19 deletions
+8
-19
tx_pool.go
core/tx_pool.go
+8
-19
No files found.
core/tx_pool.go
View file @
9702badd
...
...
@@ -339,17 +339,6 @@ func (pool *TxPool) Pending() (map[common.Address]types.Transactions, error) {
pool
.
mu
.
Lock
()
defer
pool
.
mu
.
Unlock
()
state
,
err
:=
pool
.
currentState
()
if
err
!=
nil
{
return
nil
,
err
}
// check queue first
pool
.
promoteExecutables
(
state
)
// invalidate any txs
pool
.
demoteUnexecutables
(
state
)
pending
:=
make
(
map
[
common
.
Address
]
types
.
Transactions
)
for
addr
,
list
:=
range
pool
.
pending
{
pending
[
addr
]
=
list
.
Flatten
()
...
...
@@ -551,12 +540,12 @@ func (pool *TxPool) Add(tx *types.Transaction) error {
if
err
!=
nil
{
return
err
}
state
,
err
:=
pool
.
currentState
()
if
err
!=
nil
{
return
err
}
// If we added a new transaction, run promotion checks and return
if
!
replace
{
state
,
err
:=
pool
.
currentState
()
if
err
!=
nil
{
return
err
}
pool
.
promoteExecutables
(
state
)
}
return
nil
...
...
@@ -579,11 +568,11 @@ func (pool *TxPool) AddBatch(txs []*types.Transaction) error {
}
// Only reprocess the internal state if something was actually added
if
added
>
0
{
state
,
err
:=
pool
.
currentState
()
if
err
!=
nil
{
return
err
}
if
!
replaced
{
state
,
err
:=
pool
.
currentState
()
if
err
!=
nil
{
return
err
}
pool
.
promoteExecutables
(
state
)
}
}
...
...
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