Skip to content

Commit

Permalink
Fix error handlings in processBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
Kourin1996 committed Feb 4, 2025
1 parent dd57714 commit 4ed67e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eth/gasprice/feehistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ func (oracle *Oracle) processBlock(bf *blockFees, percentiles []float64) {
if rates == nil {
rates, err = oracle.backend.GetExchangeRates(context.Background(), rpc.BlockNumberOrHashWithNumber(rpc.BlockNumber(bf.block.NumberU64())))
if err != nil {
log.Warn("Error occurred while getting exchange rates", "err", err)
log.Error("Error occurred while getting exchange rates", "err", err)
bf.err = fmt.Errorf("failed to get exchange rates: %w", err)
return
}
}
reward, err = tx.EffectiveGasTipInCelo(bf.block.BaseFee(), rates)
if err != nil {
log.Warn("Error occurred while calculating effective gas tip", "currency", tx.FeeCurrency(), "err", err)
log.Error("Error occurred while calculating effective gas tip", "currency", tx.FeeCurrency(), "err", err)
bf.err = err
return
}
}

Expand Down

0 comments on commit 4ed67e4

Please sign in to comment.