mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-21 02:04:31 +00:00
Merge branch 'other' of github.com:hinto-janai/cuprate into other
This commit is contained in:
commit
4118af2f24
1 changed files with 2 additions and 7 deletions
|
@ -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 {
|
||||
// <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 {
|
||||
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.
|
||||
|
||||
// <https://architecture.cuprate.org/oddities/le-ipv4.html>
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue