aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-09-10 15:04:50 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-09-10 15:04:50 -0500
commit46bcd91db469ef6704075de4c04f113f26dbe9b7 (patch)
treeb6892715dd9496de3f28578f7a15b355a97fa4ab /src/blockchain_db
parentMerge pull request #4230 (diff)
parentdb_lmdb: resize blockchain database when 90% filled (diff)
downloadmonero-46bcd91db469ef6704075de4c04f113f26dbe9b7.tar.xz
Merge pull request #4256
d6fc870 db_lmdb: resize blockchain database when 90% filled (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp8
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 32ed0e9a2..7e54041d7 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -545,8 +545,8 @@ bool BlockchainLMDB::need_resize(uint64_t threshold_size) const
LOG_PRINT_L1("Space used: " << size_used);
LOG_PRINT_L1("Space remaining: " << mei.me_mapsize - size_used);
LOG_PRINT_L1("Size threshold: " << threshold_size);
- float resize_percent_old = RESIZE_PERCENT;
- LOG_PRINT_L1(boost::format("Percent used: %.04f Percent threshold: %.04f") % ((double)size_used/mei.me_mapsize) % resize_percent_old);
+ float resize_percent = RESIZE_PERCENT;
+ LOG_PRINT_L1(boost::format("Percent used: %.04f Percent threshold: %.04f") % ((double)size_used/mei.me_mapsize) % resize_percent);
if (threshold_size > 0)
{
@@ -559,10 +559,6 @@ bool BlockchainLMDB::need_resize(uint64_t threshold_size) const
return false;
}
- std::mt19937 engine(std::random_device{}());
- std::uniform_real_distribution<double> fdis(0.6, 0.9);
- double resize_percent = fdis(engine);
-
if ((double)size_used / mei.me_mapsize > resize_percent)
{
LOG_PRINT_L1("Threshold met (percent-based)");
diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h
index 8ff2073da..f700d3178 100644
--- a/src/blockchain_db/lmdb/db_lmdb.h
+++ b/src/blockchain_db/lmdb/db_lmdb.h
@@ -449,7 +449,7 @@ private:
#endif
#endif
- constexpr static float RESIZE_PERCENT = 0.8f;
+ constexpr static float RESIZE_PERCENT = 0.9f;
};
} // namespace cryptonote