Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update based on coderabbit feedback
Browse files Browse the repository at this point in the history
nick-bisonai committed Aug 12, 2024
1 parent a949bec commit 3f8da09
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion node/pkg/checker/balance/app.go
Original file line number Diff line number Diff line change
@@ -299,7 +299,7 @@ func updateBalances(ctx context.Context, wallets []Wallet) {

var recentHistory []BalanceHistoryEntry
for _, entry := range wallets[i].BalanceHistory {
if entry.Timestamp.After(cutoff) {
if entry.IsRecent(cutoff) {
recentHistory = append(recentHistory, entry)
}
}
4 changes: 4 additions & 0 deletions node/pkg/checker/balance/types.go
Original file line number Diff line number Diff line change
@@ -47,3 +47,7 @@ type BalanceHistoryEntry struct {
Timestamp time.Time
Balance float64
}

func (b *BalanceHistoryEntry) IsRecent(cutoff time.Time) bool {
return b.Timestamp.After(cutoff)
}

0 comments on commit 3f8da09

Please sign in to comment.