This commit is contained in:
Rob Walker
2018-08-14 10:02:19 -07:00
parent d8991ae2ca
commit 708add0e64

View File

@ -469,21 +469,15 @@ fn main() {
} }
let addr = if let Some(s) = matches.value_of("addr") { let addr = if let Some(s) = matches.value_of("addr") {
match s.to_string().parse() { s.to_string().parse().unwrap_or_else(|e| {
Ok(addr) => addr, eprintln!("failed to parse {} as IP address error: {:?}", s, e);
Err(e) => { exit(1);
eprintln!("failed to parse {} as IP address error: {:?}", s, e); })
exit(1);
}
}
} else { } else {
match get_public_ip_addr() { get_public_ip_addr().unwrap_or_else(|e| {
Ok(addr) => addr, eprintln!("failed to get public IP, try --addr? error: {:?}", e);
Err(e) => { exit(1);
eprintln!("failed to get public IP, try --addr? error: {:?}", e); })
exit(1);
}
}
}; };
if let Some(s) = matches.value_of("tx_count") { if let Some(s) = matches.value_of("tx_count") {