Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions mempool/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package txpool
import (
"errors"
"fmt"
"maps"
"math/big"
"sync"

Expand Down Expand Up @@ -381,9 +382,7 @@ func (p *TxPool) Add(txs []*types.Transaction, sync bool) []error {
func (p *TxPool) Pending(filter PendingFilter) map[common.Address][]*LazyTransaction {
txs := make(map[common.Address][]*LazyTransaction)
for _, subpool := range p.Subpools {
for addr, set := range subpool.Pending(filter) {
txs[addr] = set
}
maps.Copy(txs, subpool.Pending(filter))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mind adding tests for these? should be pretty straightforward, looks like we already have a mocked subpool you can use here. thanks!

}
return txs
}
Expand Down Expand Up @@ -445,12 +444,8 @@ func (p *TxPool) Content() (map[common.Address][]*types.Transaction, map[common.
for _, subpool := range p.Subpools {
run, block := subpool.Content()

for addr, txs := range run {
runnable[addr] = txs
}
for addr, txs := range block {
blocked[addr] = txs
}
maps.Copy(runnable, run)
maps.Copy(blocked, block)
}
return runnable, blocked
}
Expand Down
Loading