Skip to content

Commit

Permalink
feat: also check inside Balance method
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Jul 22, 2022
1 parent cdb47ee commit db91777
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/state/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func (s *Service) SubmitPayForData(
}

func (s *Service) Balance(ctx context.Context) (*Balance, error) {
if !s.sync.Finished() {
return nil, fmt.Errorf("node is not synced up to network head yet, balances will not be current")
}
return s.accessor.Balance(ctx)
}

Expand Down

0 comments on commit db91777

Please sign in to comment.