aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-02-16 14:23:53 +0100
committerRiccardo Spagni <ric@spagni.net>2018-02-16 14:23:53 +0100
commitef47ba95c84058c04595d5e372a136c039b77b88 (patch)
treeffea0f9ff474022cd402bef553767cdf29c6075f /src
parentb5b88c274799ebb2b895b0591e7ac3673bb959d9 (diff)
parent928c1825f09d840a73d75889a21a68871e8f3164 (diff)
downloadmonzero-core-ef47ba95c84058c04595d5e372a136c039b77b88.tar.gz
monzero-core-ef47ba95c84058c04595d5e372a136c039b77b88.tar.xz
monzero-core-ef47ba95c84058c04595d5e372a136c039b77b88.zip
Merge pull request #3229
928c1825 cryptonote_protocol: guard against all threads in standby (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 9475bcaa8..ff187e8ae 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -1333,6 +1333,15 @@ skip:
break;
}
+ // this one triggers if all threads are in standby, which should not happen,
+ // but happened at least once, so we unblock at least one thread if so
+ const boost::unique_lock<boost::mutex> sync{m_sync_lock, boost::try_to_lock};
+ if (sync.owns_lock())
+ {
+ LOG_DEBUG_CC(context, "No other thread is adding blocks, resuming");
+ break;
+ }
+
if (should_download_next_span(context))
{
MDEBUG(context << " we should try for that next span too, we think we could get it faster, resuming");