rpc: quantize db size up to 5 GB in restricted mode

This commit is contained in:
moneromooo-monero 2019-02-21 12:55:55 +00:00
parent ea07a9bc61
commit a7211793ba
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 3 additions and 1 deletions

View File

@ -1736,7 +1736,9 @@ namespace cryptonote
boost::shared_lock<boost::shared_mutex> lock(m_bootstrap_daemon_mutex); boost::shared_lock<boost::shared_mutex> lock(m_bootstrap_daemon_mutex);
res.was_bootstrap_ever_used = m_was_bootstrap_ever_used; res.was_bootstrap_ever_used = m_was_bootstrap_ever_used;
} }
res.database_size = restricted ? 0 : m_core.get_blockchain_storage().get_db().get_database_size(); res.database_size = m_core.get_blockchain_storage().get_db().get_database_size();
if (restricted)
res.database_size = round_up(res.database_size, 5ull * 1024 * 1024 * 1024);
res.update_available = restricted ? false : m_core.is_update_available(); res.update_available = restricted ? false : m_core.is_update_available();
res.version = restricted ? "" : MONERO_VERSION; res.version = restricted ? "" : MONERO_VERSION;
return true; return true;