rpc: add a busy_syncing field to get_info

true if and pretty much only if new blocks are being added
This commit is contained in:
moneromooo-monero 2020-12-15 20:26:09 +00:00
parent e5decd0cde
commit 5a1ac9c0ef
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 13 additions and 1 deletions

View file

@ -2771,6 +2771,13 @@ skip:
}
//------------------------------------------------------------------------------------------------------------------------
template<class t_core>
bool t_cryptonote_protocol_handler<t_core>::is_busy_syncing()
{
const boost::unique_lock<boost::mutex> sync{m_sync_lock, boost::try_to_lock};
return !sync.owns_lock();
}
//------------------------------------------------------------------------------------------------------------------------
template<class t_core>
void t_cryptonote_protocol_handler<t_core>::drop_connection_with_score(cryptonote_connection_context &context, unsigned score, bool flush_all_spans)
{
LOG_DEBUG_CC(context, "dropping connection id " << context.m_connection_id << " (pruning seed " <<