Update binaries/cuprated/src/rpc/handlers/json_rpc.rs

Co-authored-by: Boog900 <boog900@tutanota.com>
This commit is contained in:
hinto-janai 2025-01-16 19:38:14 -05:00 committed by GitHub
parent 13f5ed9dd0
commit bc6fc0ae13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -493,11 +493,7 @@ async fn get_info(
let (database_size, free_space) = blockchain::database_size(&mut state.blockchain_read).await?; let (database_size, free_space) = blockchain::database_size(&mut state.blockchain_read).await?;
let (database_size, free_space) = if restricted { let (database_size, free_space) = if restricted {
// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L131-L134> // <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L131-L134>
const fn round_up(value: u64, quantum: u64) -> u64 { let database_size = database_size.div_ceil(5 * 1024 * 1024 * 1024);
value.div_ceil(quantum)
}
let database_size = round_up(database_size, 5 * 1024 * 1024 * 1024);
(database_size, u64::MAX) (database_size, u64::MAX)
} else { } else {
(database_size, free_space) (database_size, free_space)