protocol: reduce log level for one-block sync candidates
What changed, and why it matters
This commit changes a single log message so that it prints at the less prominent 'Debug' level instead of 'Info' when a peer reports a blockchain height only one block different from the node's own height. It is purely a logging/verbosity tweak and does not alter any network behavior, validation logic, or security mechanism.
No security action required; treat as normal logging cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In cryptonote_protocol_handler.inl, the MCLOG call for ‘Sync data returned a new top block candidate’ now uses el::Level::Info only when is_inital is true AND abs_diff > 1; otherwise it logs at el::Level::Debug. This suppresses routine one-block-difference sync-candidate messages from the default Info log output. No protocol, consensus, or cryptographic code is modified.
Changed components
src/cryptonote_protocol/cryptonote_protocol_handler.inlInspect captured patch +1 / −1
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index bb069f9..6d5e4f2 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -518,7 +518,7 @@ namespace cryptonote
uint64_t max_block_height = std::max(hshd.current_height,m_core.get_current_blockchain_height());
uint64_t last_block_v1 = m_core.get_nettype() == TESTNET ? 624633 : m_core.get_nettype() == MAINNET ? 1009826 : (uint64_t)-1;
uint64_t diff_v2 = max_block_height > last_block_v1 ? std::min(abs_diff, max_block_height - last_block_v1) : 0;
- MCLOG(is_inital ? el::Level::Info : el::Level::Debug, "global", el::Color::Yellow, context << "Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
+ MCLOG(is_inital && abs_diff > 1 ? el::Level::Info : el::Level::Debug, "global", el::Color::Yellow, context << "Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
<< " [Your node is " << abs_diff << " blocks (" << tools::get_human_readable_timespan((abs_diff - diff_v2) * DIFFICULTY_TARGET_V1 + diff_v2 * DIFFICULTY_TARGET_V2) << ") "
<< (0 <= diff ? std::string("behind") : std::string("ahead"))
<< "] " << ENDL << "SYNCHRONIZATION started");
Why this scored 15/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.