mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2025-02-28 04:20:16 +00:00
Status Submenu: add matching structs for monerod's [get_info]
This commit is contained in:
parent
4cac807ca7
commit
2d461ae4ea
1 changed files with 33 additions and 0 deletions
|
@ -1743,6 +1743,39 @@ impl Hashrate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------- PubMoneroApi
|
||||||
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
struct PubMoneroApi {
|
||||||
|
size: HumanNumber, // Blockchain size in GB
|
||||||
|
diff: HumanNumber, // Current difficulty
|
||||||
|
height: HumanNumber, // Current height
|
||||||
|
incoming: HumanNumber, // In-peers
|
||||||
|
outgoing: HumanNumber, // Out-peers
|
||||||
|
restricted: bool, // Is RPC in restricted mode?
|
||||||
|
synchronized: bool, // Are we synced?
|
||||||
|
tx_pool_size: HumanNumber, // Current amout of TX in TX pool
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------- PrivMoneroApi
|
||||||
|
// This matches some stats from monerod's JSON-RPC HTTP call [get_info]
|
||||||
|
// It _seems_ monerod initializes stats with [0], so no [Option], hopefully nothing panics :D
|
||||||
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
struct PrivMoneroApi {
|
||||||
|
result: Result,
|
||||||
|
}
|
||||||
|
struct Result {
|
||||||
|
database_size: u128, // bytes
|
||||||
|
difficulty: u128,
|
||||||
|
height: u64,
|
||||||
|
incoming_connections_count: u32,
|
||||||
|
nettype: String, // mainnet, stagenet, testnet
|
||||||
|
outgoing_connections_count: u32,
|
||||||
|
restricted: bool,
|
||||||
|
status: String, // OK
|
||||||
|
synchronized: bool,
|
||||||
|
tx_pool_size: u32, // tx pool
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------- TESTS
|
//---------------------------------------------------------------------------------------------------- TESTS
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
|
|
Loading…
Reference in a new issue