isCurrentSlotUnsetOrStale property

bool isCurrentSlotUnsetOrStale

return true if the ttl-focused current slot is stale or needs to be refreshed based on the current time and staleSlotCuttoff.

Implementation

bool get isCurrentSlotUnsetOrStale {
  if (_currentSlot == 0) return true; //not set
  final now = DateTime.now().toUtc();
  final cutoff = _currentSlotTimestamp.add(staleSlotCuttoff);
  final isStale = cutoff.isBefore(now); //cuttoff reached?
  return isStale;
}