rustfmt all the things
This commit is contained in:
+2
-6
@@ -38,7 +38,6 @@ pub fn show_status(config: &ServerConfig) {
|
||||
writeln!(e, "Last block hash: {}", status.tip.last_block_pushed).unwrap();
|
||||
writeln!(e, "Previous block hash: {}", status.tip.prev_block_to_last).unwrap();
|
||||
writeln!(e, "Total difficulty: {}", status.tip.total_difficulty).unwrap();
|
||||
|
||||
}
|
||||
Err(_) => writeln!(
|
||||
e,
|
||||
@@ -81,10 +80,7 @@ pub fn unban_peer(config: &ServerConfig, peer_addr: &SocketAddr) {
|
||||
|
||||
pub fn list_connected_peers(config: &ServerConfig) {
|
||||
let mut e = term::stdout().unwrap();
|
||||
let url = format!(
|
||||
"http://{}/v1/peers/connected",
|
||||
config.api_http_addr
|
||||
);
|
||||
let url = format!("http://{}/v1/peers/connected", config.api_http_addr);
|
||||
match api::client::get::<Vec<p2p::PeerInfo>>(url.as_str()).map_err(|e| Error::API(e)) {
|
||||
Ok(connected_peers) => {
|
||||
let mut index = 0;
|
||||
@@ -98,7 +94,7 @@ pub fn list_connected_peers(config: &ServerConfig) {
|
||||
println!();
|
||||
index = index + 1;
|
||||
}
|
||||
},
|
||||
}
|
||||
Err(_) => writeln!(e, "Failed to get connected peers").unwrap(),
|
||||
};
|
||||
e.reset().unwrap();
|
||||
|
||||
+23
-19
@@ -429,7 +429,11 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
|
||||
wallet_config.check_node_api_http_addr = sa.to_string().clone();
|
||||
}
|
||||
|
||||
let key_derivations: u32 = wallet_args.value_of("key_derivations").unwrap().parse().unwrap();
|
||||
let key_derivations: u32 = wallet_args
|
||||
.value_of("key_derivations")
|
||||
.unwrap()
|
||||
.parse()
|
||||
.unwrap();
|
||||
|
||||
let mut show_spent = false;
|
||||
if wallet_args.is_present("show_spent") {
|
||||
@@ -515,29 +519,29 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
|
||||
dest,
|
||||
selection_strategy,
|
||||
),
|
||||
Err(e) => match e.kind() {
|
||||
wallet::ErrorKind::NotEnoughFunds(available) => {
|
||||
error!(
|
||||
LOGGER,
|
||||
"Tx not sent: insufficient funds (max: {})",
|
||||
amount_to_hr_string(available),
|
||||
);
|
||||
}
|
||||
wallet::ErrorKind::FeeExceedsAmount {
|
||||
sender_amount,
|
||||
recipient_fee,
|
||||
} => {
|
||||
error!(
|
||||
Err(e) => match e.kind() {
|
||||
wallet::ErrorKind::NotEnoughFunds(available) => {
|
||||
error!(
|
||||
LOGGER,
|
||||
"Tx not sent: insufficient funds (max: {})",
|
||||
amount_to_hr_string(available),
|
||||
);
|
||||
}
|
||||
wallet::ErrorKind::FeeExceedsAmount {
|
||||
sender_amount,
|
||||
recipient_fee,
|
||||
} => {
|
||||
error!(
|
||||
LOGGER,
|
||||
"Recipient rejected the transfer because transaction fee ({}) exceeded amount ({}).",
|
||||
amount_to_hr_string(recipient_fee),
|
||||
amount_to_hr_string(sender_amount)
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
error!(LOGGER, "Tx not sent: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
error!(LOGGER, "Tx not sent: {:?}", e);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
("burn", Some(send_args)) => {
|
||||
|
||||
Reference in New Issue
Block a user