Skip to content

Commit 39ce64b

Browse files
committed
core/txpool/legacypool: move addressesByHeartbeat to queue
Signed-off-by: Csaba Kiraly <[email protected]>
1 parent 07d2827 commit 39ce64b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

core/txpool/legacypool/legacypool.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,18 +1569,6 @@ func (pool *LegacyPool) demoteUnexecutables() {
15691569
}
15701570
}
15711571

1572-
// addressByHeartbeat is an account address tagged with its last activity timestamp.
1573-
type addressByHeartbeat struct {
1574-
address common.Address
1575-
heartbeat time.Time
1576-
}
1577-
1578-
type addressesByHeartbeat []addressByHeartbeat
1579-
1580-
func (a addressesByHeartbeat) Len() int { return len(a) }
1581-
func (a addressesByHeartbeat) Less(i, j int) bool { return a[i].heartbeat.Before(a[j].heartbeat) }
1582-
func (a addressesByHeartbeat) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
1583-
15841572
// accountSet is simply a set of addresses to check for existence, and a signer
15851573
// capable of deriving addresses from transactions.
15861574
type accountSet struct {

core/txpool/legacypool/queue.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,15 @@ func (q *queue) truncate() []common.Hash {
240240
}
241241
return removed
242242
}
243+
244+
// addressByHeartbeat is an account address tagged with its last activity timestamp.
245+
type addressByHeartbeat struct {
246+
address common.Address
247+
heartbeat time.Time
248+
}
249+
250+
type addressesByHeartbeat []addressByHeartbeat
251+
252+
func (a addressesByHeartbeat) Len() int { return len(a) }
253+
func (a addressesByHeartbeat) Less(i, j int) bool { return a[i].heartbeat.Before(a[j].heartbeat) }
254+
func (a addressesByHeartbeat) Swap(i, j int) { a[i], a[j] = a[j], a[i] }

0 commit comments

Comments
 (0)