Skip to content

Commit

Permalink
Merge pull request ethereum#8 from XWJACK/rpc-ext
Browse files Browse the repository at this point in the history
fix priced
  • Loading branch information
XWJACK authored Jul 12, 2022
2 parents a4fcff4 + 24d83ec commit 97c5076
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions core/tx_pool_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ import (
// "github.com/ethereum/go-ethereum/params"
)

// Content retrieves the data content of the transaction pool, returning all the
// pending as well as queued transactions, grouped by account and sorted by nonce.
// return pending txs sorted by price and nonce (may be included in the future)
func (pool *TxPool) Priced() types.Transactions {
pool.priced.reheapMu.Lock()
defer pool.priced.reheapMu.Unlock()
pending := pool.Pending(true)

return pool.priced.urgent.list
// Sort the transactions and cross check the nonce ordering
txset := types.NewTransactionsByPriceAndNonce(pool.signer, pending, pool.priced.urgent.baseFee)

txs := types.Transactions{}
for tx := txset.Peek(); tx != nil; tx = txset.Peek() {
txs = append(txs, tx)
txset.Shift()
}
return txs
}

0 comments on commit 97c5076

Please sign in to comment.