Skip to content

Commit

Permalink
eth/gasprice: improve stability of estimated price (ethereum#22722)
Browse files Browse the repository at this point in the history
This PR makes the gas price oracle ignore transactions priced at `<=1 wei`.
  • Loading branch information
GregTheGreek committed Apr 28, 2021
1 parent 0c99868 commit 256c5d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ func (gpo *Oracle) getBlockPrices(ctx context.Context, signer types.Signer, bloc

var prices []*big.Int
for _, tx := range txs {
if tx.GasPriceIntCmp(common.Big1) <= 0 {
continue
}
sender, err := types.Sender(signer, tx)
if err == nil && sender != block.Coinbase() {
prices = append(prices, tx.GasPrice())
Expand Down

0 comments on commit 256c5d6

Please sign in to comment.