diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-15 20:22:08 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-17 18:11:56 +0000 |
commit | a4cdcd9bd05d55436d1db15ba77949ec5f65c529 (patch) | |
tree | 8711f7f4b70c805020f01da5af3e22a826aee200 /src/cryptonote_protocol/cryptonote_protocol_handler.inl | |
parent | Merge pull request #7131 (diff) | |
download | monero-a4cdcd9bd05d55436d1db15ba77949ec5f65c529.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 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-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 d4c3b51c3..2e0f67486 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 " << |