mirror of
https://github.com/wownero/wownero.git
synced 2026-10-23 02:18:34 +02:00
lmdb: retain percentage fallback for batch resizing
This commit is contained in:
@@ -617,18 +617,13 @@ bool BlockchainLMDB::need_resize(uint64_t threshold_size) const
|
|||||||
float resize_percent = RESIZE_PERCENT;
|
float resize_percent = RESIZE_PERCENT;
|
||||||
MDEBUG(boost::format("Percent used: %.04f Percent threshold: %.04f") % (100.*size_used/mei.me_mapsize) % (100.*resize_percent));
|
MDEBUG(boost::format("Percent used: %.04f Percent threshold: %.04f") % (100.*size_used/mei.me_mapsize) % (100.*resize_percent));
|
||||||
|
|
||||||
if (threshold_size > 0)
|
if (threshold_size > 0 && mei.me_mapsize - size_used <= threshold_size)
|
||||||
{
|
{
|
||||||
if (mei.me_mapsize - size_used < threshold_size)
|
MINFO("Threshold met (size-based)");
|
||||||
{
|
return true;
|
||||||
MINFO("Threshold met (size-based)");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((double)size_used / mei.me_mapsize > resize_percent)
|
if ((double)size_used / mei.me_mapsize >= resize_percent)
|
||||||
{
|
{
|
||||||
MINFO("Threshold met (percent-based)");
|
MINFO("Threshold met (percent-based)");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user