Skip to content

Commit

Permalink
eth/gasprice: reduce default gas price for empty block
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Nov 12, 2024
1 parent 62ffaf2 commit 6828b15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ func (oracle *Oracle) SuggestTipCap(ctx context.Context) (*big.Int, error) {
// Nothing returned. There are two special cases here:
// - The block is empty
// - All the transactions included are sent by the miner itself.
// In these cases, use the latest calculated price for samping.
// In these cases, use half of the latest calculated price for samping.
if len(res.values) == 0 {
res.values = []*big.Int{lastPrice}
res.values = []*big.Int{new(big.Int).Div(lastPrice, common.Big2)}
}
// Besides, in order to collect enough data for sampling, if nothing
// meaningful returned, try to query more blocks. But the maximum
Expand Down

0 comments on commit 6828b15

Please sign in to comment.