X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fcli.rs;h=bf2f7929434de90f1fe9d9fd5f9f7fe9fb59a8df;hb=1c40f4960a63501e28fb7cb77b9d294d357395b3;hp=b392f0f355019a9b42cae0230afdc7b92c76af33;hpb=479964a45b965cbdbd4a0ca8e43cbd307ddc989b;p=ldk-sample diff --git a/src/cli.rs b/src/cli.rs index b392f0f..bf2f792 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ use crate::disk; use crate::hex_utils; use crate::{ - ChannelManager, HTLCStatus, InvoicePayer, MillisatAmount, NetworkGraph, PaymentInfo, + ChannelManager, HTLCStatus, InvoicePayer, MillisatAmount, NetworkGraph, NodeAlias, PaymentInfo, PaymentInfoStorage, PeerManager, }; use bitcoin::hashes::sha256::Hash as Sha256; @@ -457,19 +457,6 @@ fn list_peers(peer_manager: Arc) { println!("\t}},"); } -/// Takes some untrusted bytes and returns a sanitized string that is safe to print -fn sanitize_string(bytes: &[u8]) -> String { - let mut ret = String::with_capacity(bytes.len()); - // We should really support some sane subset of UTF-8 here, but limiting to printable ASCII - // instead makes this trivial. - for b in bytes { - if *b >= 0x20 && *b <= 0x7e { - ret.push(*b as char); - } - } - ret -} - fn list_channels(channel_manager: &Arc, network_graph: &Arc) { print!("["); for chan_info in channel_manager.list_channels() { @@ -490,7 +477,7 @@ fn list_channels(channel_manager: &Arc, network_graph: &Arc