aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-28 16:04:43 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-28 16:06:15 +0000
commit65301c406e6d5e5a72c40dfdca62f018fcff0db9 (patch)
treef18627e0c6bd62c986d872cd68787d6abb328c1d /src
parentMerge pull request #6036 (diff)
downloadmonero-65301c406e6d5e5a72c40dfdca62f018fcff0db9.tar.xz
core: point out when we hit the block rate visibility limit
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index acb494a49..0ac45be18 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -1881,9 +1881,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)
@@ -1895,7 +1896,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)