diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-02-06 00:28:18 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-02-06 00:28:18 -0800 |
commit | 9a08ac98c0205fa55c41d6ef1b3a11d5500387d8 (patch) | |
tree | 8ea0aa688e7784bca6449405c9e45df85e2e7210 | |
parent | Merge pull request #6040 (diff) | |
parent | core: point out when we hit the block rate visibility limit (diff) | |
download | monero-9a08ac98c0205fa55c41d6ef1b3a11d5500387d8.tar.xz |
Merge pull request #6050
65301c40 core: point out when we hit the block rate visibility limit (moneromooo-monero)
-rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 23f13000c..288f76222 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1895,9 +1895,10 @@ namespace cryptonote } static constexpr double threshold = 1. / (864000 / DIFFICULTY_TARGET_V2); // one false positive every 10 days + static constexpr unsigned int max_blocks_checked = 150; const time_t now = time(NULL); - const std::vector<time_t> timestamps = m_blockchain_storage.get_last_block_timestamps(60); + const std::vector<time_t> timestamps = m_blockchain_storage.get_last_block_timestamps(max_blocks_checked); static const unsigned int seconds[] = { 5400, 3600, 1800, 1200, 600 }; for (size_t n = 0; n < sizeof(seconds)/sizeof(seconds[0]); ++n) @@ -1909,7 +1910,7 @@ namespace cryptonote MDEBUG("blocks in the last " << seconds[n] / 60 << " minutes: " << b << " (probability " << p << ")"); if (p < threshold) { - MWARNING("There were " << b << " blocks in the last " << seconds[n] / 60 << " minutes, there might be large hash rate changes, or we might be partitioned, cut off from the Monero network or under attack. Or it could be just sheer bad luck."); + MWARNING("There were " << b << (b == max_blocks_checked ? " or more" : "") << " blocks in the last " << seconds[n] / 60 << " minutes, there might be large hash rate changes, or we might be partitioned, cut off from the Monero network or under attack. Or it could be just sheer bad luck."); std::shared_ptr<tools::Notify> block_rate_notify = m_block_rate_notify; if (block_rate_notify) |