diff --git a/binaries/cuprated/src/rpc/handlers/json_rpc.rs b/binaries/cuprated/src/rpc/handlers/json_rpc.rs index 1e4c10f..99e425a 100644 --- a/binaries/cuprated/src/rpc/handlers/json_rpc.rs +++ b/binaries/cuprated/src/rpc/handlers/json_rpc.rs @@ -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) = if restricted { // - const fn round_up(value: u64, quantum: u64) -> u64 { - value.div_ceil(quantum) - } - - let database_size = round_up(database_size, 5 * 1024 * 1024 * 1024); + let database_size = database_size.div_ceil(5 * 1024 * 1024 * 1024); (database_size, u64::MAX) } else { (database_size, free_space) @@ -637,8 +633,7 @@ async fn set_bans( // TODO: support non-clearnet addresses. // - let [a, b, c, d] = peer.ip.to_le_bytes(); - let ip = Ipv4Addr::new(a, b, c, d); + let ip = Ipv4Addr::from(peer.ip.to_le_bytes()); let address = SocketAddr::V4(SocketAddrV4::new(ip, 0)); let ban = if peer.ban {