What changed, and why it matters
This patch fixes a minor logic bug in how Monero estimates how long blockchain synchronization will take. Previously, the sync start time and start height were reset every time a new batch of blocks was requested, which could make the time estimate jump around or look wrong. Now they are set only once per sync. There is no indication this is a security issue; it is a user-experience/accuracy fix.
No security action required. Treat as a normal bugfix / UX improvement. If triaging for a release, include it for more stable sync-time estimates.
Security signals we found
No security-relevant signals present in diff or commit metadata
Change is confined to sync-progress estimation variables
No input validation, memory handling, or cryptographic changes
Evidence from the diff
The change initializes m_sync_start_height to 0 and wraps the sync-start timestamp/height assignment in a guard: if (m_sync_start_time.is_not_a_date_time()). This prevents re-initialization on every invocation of the download loop, so the periodic sync estimate is computed against a stable baseline. The patch is purely about estimate accuracy and does not touch validation, consensus, cryptography, or network parsing.
Changed components
src/cryptonote_protocol/cryptonote_protocol_handler.hsrc/cryptonote_protocol/cryptonote_protocol_handler.inlInspect captured patch +7 / −4
### src/cryptonote_protocol/cryptonote_protocol_handler.h
@@ -205,7 +205,7 @@ namespace cryptonote
// Values for sync time estimates
boost::posix_time::ptime m_sync_start_time;
boost::posix_time::ptime m_period_start_time;
- uint64_t m_sync_start_height;
+ uint64_t m_sync_start_height = 0;
uint64_t m_period_start_height;
uint64_t get_estimated_remaining_sync_seconds(uint64_t current_blockchain_height, uint64_t target_blockchain_height);
std::string get_periodic_sync_estimate(uint64_t current_blockchain_height, uint64_t target_blockchain_height);
### src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -1383,9 +1383,12 @@ namespace cryptonote
if (!starting)
m_last_add_end_time = tools::get_tick_count();
});
- m_sync_start_time = boost::posix_time::microsec_clock::universal_time();
- m_sync_start_height = m_core.get_current_blockchain_height();
- m_period_start_time = m_sync_start_time;
+ if (m_sync_start_time.is_not_a_date_time())
+ {
+ m_sync_start_time = boost::posix_time::microsec_clock::universal_time();
+ m_sync_start_height = m_core.get_current_blockchain_height();
+ m_period_start_time = m_sync_start_time;
+ }
while (1)
{Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.