Skip to content

Commit

Permalink
fix: disable block fetching until past the window
Browse files Browse the repository at this point in the history
  • Loading branch information
PhearZero committed Oct 24, 2024
1 parent 55e3fbb commit 2cda040
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ type BlockMetrics struct {

func GetBlockMetrics(ctx context.Context, client *api.ClientWithResponses, round uint64, window int) (*BlockMetrics, error) {
var avgs BlockMetrics

if round < uint64(window) {
avgs.AvgTime = 0
avgs.TPS = 0
return &avgs, nil
}
var format api.GetBlockParamsFormat = "json"
a, err := client.GetBlockWithResponse(ctx, int(round), &api.GetBlockParams{
Format: &format,
Expand Down

0 comments on commit 2cda040

Please sign in to comment.