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
27a278e6
Commit
27a278e6
authored
Jul 25, 2018
by
Antoine Rondelet
Committed by
Péter Szilágyi
Jul 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fixed typo in addresssByHeartbeat (#17243)
parent
a0bcb168
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
tx_pool.go
core/tx_pool.go
+5
-5
No files found.
core/tx_pool.go
View file @
27a278e6
...
@@ -1041,7 +1041,7 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) {
...
@@ -1041,7 +1041,7 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) {
}
}
if
queued
>
pool
.
config
.
GlobalQueue
{
if
queued
>
pool
.
config
.
GlobalQueue
{
// Sort all accounts with queued transactions by heartbeat
// Sort all accounts with queued transactions by heartbeat
addresses
:=
make
(
addresssByHeartbeat
,
0
,
len
(
pool
.
queue
))
addresses
:=
make
(
address
e
sByHeartbeat
,
0
,
len
(
pool
.
queue
))
for
addr
:=
range
pool
.
queue
{
for
addr
:=
range
pool
.
queue
{
if
!
pool
.
locals
.
contains
(
addr
)
{
// don't drop locals
if
!
pool
.
locals
.
contains
(
addr
)
{
// don't drop locals
addresses
=
append
(
addresses
,
addressByHeartbeat
{
addr
,
pool
.
beats
[
addr
]})
addresses
=
append
(
addresses
,
addressByHeartbeat
{
addr
,
pool
.
beats
[
addr
]})
...
@@ -1127,11 +1127,11 @@ type addressByHeartbeat struct {
...
@@ -1127,11 +1127,11 @@ type addressByHeartbeat struct {
heartbeat
time
.
Time
heartbeat
time
.
Time
}
}
type
addresssByHeartbeat
[]
addressByHeartbeat
type
address
e
sByHeartbeat
[]
addressByHeartbeat
func
(
a
addresssByHeartbeat
)
Len
()
int
{
return
len
(
a
)
}
func
(
a
address
e
sByHeartbeat
)
Len
()
int
{
return
len
(
a
)
}
func
(
a
addresssByHeartbeat
)
Less
(
i
,
j
int
)
bool
{
return
a
[
i
]
.
heartbeat
.
Before
(
a
[
j
]
.
heartbeat
)
}
func
(
a
address
e
sByHeartbeat
)
Less
(
i
,
j
int
)
bool
{
return
a
[
i
]
.
heartbeat
.
Before
(
a
[
j
]
.
heartbeat
)
}
func
(
a
addresssByHeartbeat
)
Swap
(
i
,
j
int
)
{
a
[
i
],
a
[
j
]
=
a
[
j
],
a
[
i
]
}
func
(
a
address
e
sByHeartbeat
)
Swap
(
i
,
j
int
)
{
a
[
i
],
a
[
j
]
=
a
[
j
],
a
[
i
]
}
// accountSet is simply a set of addresses to check for existence, and a signer
// accountSet is simply a set of addresses to check for existence, and a signer
// capable of deriving addresses from transactions.
// capable of deriving addresses from transactions.
...
...
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