core/txpool: use priceList.Put instead of heap.Push (#26863)

Minor refactor to use the 'intended' accessor
This commit is contained in:
ucwong 2023-03-13 02:45:25 -06:00 committed by GitHub
parent a20e38720c
commit d1c5f918a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,7 +17,6 @@
package txpool package txpool
import ( import (
"container/heap"
"errors" "errors"
"fmt" "fmt"
"math" "math"
@ -750,7 +749,7 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e
// Add all transactions back to the priced queue // Add all transactions back to the priced queue
if replacesPending { if replacesPending {
for _, dropTx := range drop { for _, dropTx := range drop {
heap.Push(&pool.priced.urgent, dropTx) pool.priced.Put(dropTx, false)
} }
log.Trace("Discarding future transaction replacing pending tx", "hash", hash) log.Trace("Discarding future transaction replacing pending tx", "hash", hash)
return false, ErrFutureReplacePending return false, ErrFutureReplacePending