mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
Update evictheap.go
This commit is contained in:
parent
8a19c2e443
commit
b5e6a5847f
1 changed files with 4 additions and 6 deletions
|
|
@ -49,16 +49,14 @@ type evictHeap struct {
|
||||||
func newPriceHeap(basefee *uint256.Int, blobfee *uint256.Int, index map[common.Address][]*blobTxMeta) *evictHeap {
|
func newPriceHeap(basefee *uint256.Int, blobfee *uint256.Int, index map[common.Address][]*blobTxMeta) *evictHeap {
|
||||||
heap := &evictHeap{
|
heap := &evictHeap{
|
||||||
metas: index,
|
metas: index,
|
||||||
index: make(map[common.Address]int, len(*index)),
|
index: make(map[common.Address]int, len(index)),
|
||||||
}
|
}
|
||||||
// Populate the heap in account sort order. Not really needed in practice,
|
// Populate the heap in account sort order. Not really needed in practice,
|
||||||
// but it makes the heap initialization deterministic and less annoying to
|
// but it makes the heap initialization deterministic and less annoying to
|
||||||
// test in unit tests.
|
// test in unit tests.
|
||||||
addrs := maps.Keys(*index)
|
heap.addrs = maps.Keys(index)
|
||||||
slices.SortFunc(addrs, common.Address.Cmp)
|
slices.SortFunc(heap.addrs, common.Address.Cmp)
|
||||||
|
for i, addr := range heap.index {
|
||||||
heap.addrs = addrs
|
|
||||||
for i, addr := range addrs {
|
|
||||||
heap.index[addr] = i
|
heap.index[addr] = i
|
||||||
}
|
}
|
||||||
heap.reinit(basefee, blobfee, true)
|
heap.reinit(basefee, blobfee, true)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue