@@ -48,7 +48,8 @@ func (m *GasEstimator) Stats(fromNumber uint64, priorityPerc float64) (GasSugges
4848 }
4949 gasPercs , err := quantilesFromFloatArray (baseFees )
5050 if err != nil {
51- return GasSuggestions {}, err
51+ L .Debug ().Err (err ).Msg ("Error calculating gas percentiles. Will use partial data." )
52+ // return GasSuggestions{}, err
5253 }
5354 tips := make ([]float64 , 0 )
5455 for _ , bf := range hist .Reward {
@@ -64,7 +65,8 @@ func (m *GasEstimator) Stats(fromNumber uint64, priorityPerc float64) (GasSugges
6465 }
6566 tipPercs , err := quantilesFromFloatArray (tips )
6667 if err != nil {
67- return GasSuggestions {}, err
68+ // return GasSuggestions{}, err
69+ L .Debug ().Err (err ).Msg ("Error calculating tip percentiles. Will use partial data." )
6870 }
6971 suggestedGasPrice , err := m .Client .Client .SuggestGasPrice (context .Background ())
7072 if err != nil {
@@ -105,23 +107,28 @@ type GasSuggestions struct {
105107func quantilesFromFloatArray (fa []float64 ) (* GasPercentiles , error ) {
106108 perMax , err := stats .Max (fa )
107109 if err != nil {
108- return nil , err
110+ L .Debug ().Err (err ).Msg ("Error calculating max gas price. Continuing" )
111+ // return nil, err
109112 }
110113 perc99 , err := stats .Percentile (fa , 99 )
111114 if err != nil {
112- return nil , err
115+ L .Debug ().Err (err ).Msg ("Error calculating p99 gas price. Continuing" )
116+ // return nil, err
113117 }
114118 perc75 , err := stats .Percentile (fa , 75 )
115119 if err != nil {
116- return nil , err
120+ L .Debug ().Err (err ).Msg ("Error calculating p75 gas price. Continuing" )
121+ // return nil, err
117122 }
118123 perc50 , err := stats .Percentile (fa , 50 )
119124 if err != nil {
120- return nil , err
125+ L .Debug ().Err (err ).Msg ("Error calculating p50 gas price. Continuing" )
126+ // return nil, err
121127 }
122128 perc25 , err := stats .Percentile (fa , 25 )
123129 if err != nil {
124- return nil , err
130+ L .Debug ().Err (err ).Msg ("Error calculating p25 gas price. Continuing" )
131+ // return nil, err
125132 }
126133 return & GasPercentiles {
127134 Max : perMax ,
0 commit comments