Merge branch 'other' of github.com:hinto-janai/cuprate into other

This commit is contained in:
hinto.janai 2025-01-16 19:39:23 -05:00
commit 4118af2f24
No known key found for this signature in database
GPG key ID: D47CE05FA175A499

View file

@ -487,11 +487,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)
@ -637,8 +633,7 @@ async fn set_bans(
// TODO: support non-clearnet addresses. // TODO: support non-clearnet addresses.
// <https://architecture.cuprate.org/oddities/le-ipv4.html> // <https://architecture.cuprate.org/oddities/le-ipv4.html>
let [a, b, c, d] = peer.ip.to_le_bytes(); let ip = Ipv4Addr::from(peer.ip.to_le_bytes());
let ip = Ipv4Addr::new(a, b, c, d);
let address = SocketAddr::V4(SocketAddrV4::new(ip, 0)); let address = SocketAddr::V4(SocketAddrV4::new(ip, 0));
let ban = if peer.ban { let ban = if peer.ban {