1
0
Fork 0
forked from lthn/blockchain

time sync problems detection: final fixes

This commit is contained in:
sowle 2019-06-11 18:24:16 +03:00
parent 7a1f1f7426
commit 627f3c2c56
2 changed files with 3 additions and 3 deletions

View file

@ -811,7 +811,7 @@ namespace currency
std::vector<int64_t> time_deltas_copy(m_time_deltas.begin(), m_time_deltas.end());
int64_t m_last_median2local_time_difference = epee::misc_utils::median(time_deltas_copy);
m_last_median2local_time_difference = epee::misc_utils::median(time_deltas_copy);
LOG_PRINT_MAGENTA("TIME: network time difference is " << m_last_median2local_time_difference << " (max is " << TIME_SYNC_DELTA_TO_LOCAL_MAX_DIFFERENCE << ")", LOG_LEVEL_2);
if (std::abs(m_last_median2local_time_difference) > TIME_SYNC_DELTA_TO_LOCAL_MAX_DIFFERENCE)
{
@ -826,7 +826,7 @@ namespace currency
// got ntp time correctly
// update local time, because getting ntp time could be time consuming
uint64_t local_time_2 = m_core.get_blockchain_storage().get_core_runtime_config().get_core_time();
int64_t m_last_ntp2local_time_difference = local_time_2 - ntp_time;
m_last_ntp2local_time_difference = local_time_2 - ntp_time;
if (std::abs(m_last_ntp2local_time_difference) > TIME_SYNC_NTP_TO_LOCAL_MAX_DIFFERENCE)
{
// local time is out of sync

View file

@ -461,7 +461,7 @@ bool daemon_backend::update_state_info()
{
view::daemon_status_info dsi = AUTO_VAL_INIT(dsi);
currency::COMMAND_RPC_GET_INFO::request req = AUTO_VAL_INIT(req);
req.flags = COMMAND_RPC_GET_INFO_FLAG_EXPIRATIONS_MEDIAN;
req.flags = COMMAND_RPC_GET_INFO_FLAG_EXPIRATIONS_MEDIAN | COMMAND_RPC_GET_INFO_FLAG_NET_TIME_DELTA_MEDIAN;
currency::COMMAND_RPC_GET_INFO::response inf = AUTO_VAL_INIT(inf);
if (!m_rpc_proxy->call_COMMAND_RPC_GET_INFO(req, inf))
{