From bc6fc0ae1337f9cb2c7dd02d6f548f539c86c806 Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Thu, 16 Jan 2025 19:38:14 -0500 Subject: [PATCH 1/2] Update binaries/cuprated/src/rpc/handlers/json_rpc.rs Co-authored-by: Boog900 --- binaries/cuprated/src/rpc/handlers/json_rpc.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/binaries/cuprated/src/rpc/handlers/json_rpc.rs b/binaries/cuprated/src/rpc/handlers/json_rpc.rs index 4f7f00c..1ca244a 100644 --- a/binaries/cuprated/src/rpc/handlers/json_rpc.rs +++ b/binaries/cuprated/src/rpc/handlers/json_rpc.rs @@ -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) = 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) From c7443c9140c845ca0708006c470d5d69d9ac38ba Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Thu, 16 Jan 2025 19:38:30 -0500 Subject: [PATCH 2/2] Update binaries/cuprated/src/rpc/handlers/json_rpc.rs Co-authored-by: Boog900 --- binaries/cuprated/src/rpc/handlers/json_rpc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/binaries/cuprated/src/rpc/handlers/json_rpc.rs b/binaries/cuprated/src/rpc/handlers/json_rpc.rs index 1ca244a..dace71b 100644 --- a/binaries/cuprated/src/rpc/handlers/json_rpc.rs +++ b/binaries/cuprated/src/rpc/handlers/json_rpc.rs @@ -639,8 +639,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 {