Skip to content

Commit

Permalink
Fix ineffectual err
Browse files Browse the repository at this point in the history
  • Loading branch information
kacpersaw committed Jul 16, 2024
1 parent 3788491 commit 5ab886e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/storage/storagereader/epochs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func (s *Reader) GetEpochs(ctx context.Context, query *bson.D, opts ...*options.
epoch.Stats.Cumulative.RewardsNumber = count

atxCount, err := s.CountActivations(context.Background(), &bson.D{{Key: "targetEpoch", Value: epoch.Number}})
if err != nil {
return nil, err
}
epoch.Stats.Current.Smeshers = atxCount
}

Expand All @@ -66,13 +69,19 @@ func (s *Reader) GetEpoch(ctx context.Context, epochNumber int) (*model.Epoch, e
total, count, err := s.GetTotalRewards(context.TODO(), &bson.D{{Key: "layer", Value: bson.D{
{Key: "$gte", Value: epoch.LayerStart}, {Key: "$lte", Value: epoch.LayerEnd}}},
})
if err != nil {
return nil, err
}

epoch.Stats.Current.Rewards = total
epoch.Stats.Current.RewardsNumber = count
epoch.Stats.Cumulative.Rewards = total
epoch.Stats.Cumulative.RewardsNumber = count

atxCount, err := s.CountActivations(context.Background(), &bson.D{{Key: "targetEpoch", Value: epoch.Number}})
if err != nil {
return nil, err
}
epoch.Stats.Current.Smeshers = atxCount
epoch.Stats.Cumulative.Smeshers = atxCount

Expand Down

0 comments on commit 5ab886e

Please sign in to comment.