Revert change to (*PendingPool) EnforceBestInvariants() (#537)

This commit is contained in:
Andrew Ashikhmin 2022-07-20 16:49:11 +02:00 committed by GitHub
parent 114da7eca3
commit 046e4165b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ import (
"fmt"
"math"
"runtime"
"sort"
"sync"
"time"
@ -48,7 +49,6 @@ import (
"github.com/ledgerwatch/erigon-lib/types"
"github.com/ledgerwatch/log/v3"
"go.uber.org/atomic"
"golang.org/x/exp/slices"
)
var (
@ -2041,7 +2041,7 @@ func (p *PendingPool) EnforceWorstInvariants() {
heap.Init(p.worst)
}
func (p *PendingPool) EnforceBestInvariants() {
slices.SortFunc(p.best.ms, func(i, j *metaTx) bool { return i.better(j, p.best.pendingBaseFee) })
sort.Sort(p.best)
}
func (p *PendingPool) Best() *metaTx { //nolint