diff --git a/src/connectivity/time_manager.cpp b/src/connectivity/time_manager.cpp index efd0353..0643e9a 100644 --- a/src/connectivity/time_manager.cpp +++ b/src/connectivity/time_manager.cpp @@ -44,12 +44,13 @@ bool TimeManager::ntp_sync_successful(void) const bool TimeManager::ntp_sync_overdue(void) { + bool retval = false; + if (!ntp_sync_successful()) { - return false; + return retval; } - bool retval = false; // after the ntp sync update delay has been reached six times, the sync is considered overdue if (_now >= (_ntp_sync_timestamp_s + (time_t)(6 * (sntp_update_delay_MS_rfc_not_less_than_15000() / 1000)))) { @@ -61,12 +62,13 @@ bool TimeManager::ntp_sync_overdue(void) bool TimeManager::ntp_sync_timeout(void) { + bool retval = false; + if (!ntp_sync_successful()) { - return false; + return retval; } - bool retval = false; // after the maxmimum offline time has been reached, the sync is considered timed out if (_now >= (_ntp_sync_timestamp_s + (time_t)_ntp_max_offline_time_s)) {