diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-15 20:26:09 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-17 18:03:11 +0000 |
commit | 5a1ac9c0ef87f3f4fdc62a713d7336aa13211928 (patch) | |
tree | f049517188e84e41083df0a5c6127ca43d9789da /src/cryptonote_protocol/cryptonote_protocol_handler.inl | |
parent | Merge pull request #7130 (diff) | |
download | monero-5a1ac9c0ef87f3f4fdc62a713d7336aa13211928.tar.xz |
rpc: add a busy_syncing field to get_info
true if and pretty much only if new blocks are being added
Diffstat (limited to '')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 2df5b74a8..e2598e382 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -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 " << |