mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
core/txpool/legacypool: move addressesByHeartbeat to queue
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
07d28277af
commit
39ce64b8b0
2 changed files with 12 additions and 12 deletions
|
|
@ -1569,18 +1569,6 @@ func (pool *LegacyPool) demoteUnexecutables() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// addressByHeartbeat is an account address tagged with its last activity timestamp.
|
|
||||||
type addressByHeartbeat struct {
|
|
||||||
address common.Address
|
|
||||||
heartbeat time.Time
|
|
||||||
}
|
|
||||||
|
|
||||||
type addressesByHeartbeat []addressByHeartbeat
|
|
||||||
|
|
||||||
func (a addressesByHeartbeat) Len() int { return len(a) }
|
|
||||||
func (a addressesByHeartbeat) Less(i, j int) bool { return a[i].heartbeat.Before(a[j].heartbeat) }
|
|
||||||
func (a addressesByHeartbeat) 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.
|
||||||
type accountSet struct {
|
type accountSet struct {
|
||||||
|
|
|
||||||
|
|
@ -240,3 +240,15 @@ func (q *queue) truncate() []common.Hash {
|
||||||
}
|
}
|
||||||
return removed
|
return removed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// addressByHeartbeat is an account address tagged with its last activity timestamp.
|
||||||
|
type addressByHeartbeat struct {
|
||||||
|
address common.Address
|
||||||
|
heartbeat time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
type addressesByHeartbeat []addressByHeartbeat
|
||||||
|
|
||||||
|
func (a addressesByHeartbeat) Len() int { return len(a) }
|
||||||
|
func (a addressesByHeartbeat) Less(i, j int) bool { return a[i].heartbeat.Before(a[j].heartbeat) }
|
||||||
|
func (a addressesByHeartbeat) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue