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
a633a2d7
Commit
a633a2d7
authored
Jun 30, 2017
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: Prevent local tx:s from being discarded
parent
67aff498
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
tx_pool.go
core/tx_pool.go
+12
-7
No files found.
core/tx_pool.go
View file @
a633a2d7
...
...
@@ -725,12 +725,14 @@ func (pool *TxPool) promoteExecutables(state *state.StateDB, accounts []common.A
pool
.
promoteTx
(
addr
,
hash
,
tx
)
}
// Drop all transactions over the allowed limit
for
_
,
tx
:=
range
list
.
Cap
(
int
(
pool
.
config
.
AccountQueue
))
{
hash
:=
tx
.
Hash
()
delete
(
pool
.
all
,
hash
)
pool
.
priced
.
Removed
()
queuedRateLimitCounter
.
Inc
(
1
)
log
.
Trace
(
"Removed cap-exceeding queued transaction"
,
"hash"
,
hash
)
if
!
pool
.
locals
.
containsAddress
(
addr
)
{
for
_
,
tx
:=
range
list
.
Cap
(
int
(
pool
.
config
.
AccountQueue
))
{
hash
:=
tx
.
Hash
()
delete
(
pool
.
all
,
hash
)
pool
.
priced
.
Removed
()
queuedRateLimitCounter
.
Inc
(
1
)
log
.
Trace
(
"Removed cap-exceeding queued transaction"
,
"hash"
,
hash
)
}
}
queued
+=
uint64
(
list
.
Len
())
...
...
@@ -815,7 +817,10 @@ func (pool *TxPool) promoteExecutables(state *state.StateDB, accounts []common.A
// Sort all accounts with queued transactions by heartbeat
addresses
:=
make
(
addresssByHeartbeat
,
0
,
len
(
pool
.
queue
))
for
addr
:=
range
pool
.
queue
{
addresses
=
append
(
addresses
,
addressByHeartbeat
{
addr
,
pool
.
beats
[
addr
]})
// Don't drop locals
if
!
pool
.
locals
.
containsAddress
(
addr
)
{
addresses
=
append
(
addresses
,
addressByHeartbeat
{
addr
,
pool
.
beats
[
addr
]})
}
}
sort
.
Sort
(
addresses
)
...
...
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