Skip to content

Commit

Permalink
cleaned up prints
Browse files Browse the repository at this point in the history
  • Loading branch information
toneloc committed Oct 5, 2024
1 parent e8722f0 commit 67578b0
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,21 @@ fn main() {
print!("Closing all channels.")
},
(Some("listallchannels"), []) => {
println!("channels:");
for channel in user.list_channels().iter() {
let channel_id = channel.channel_id;
println!("{}", channel_id);
}
println!("channel details:");
let channels = user.list_channels();
println!("{:#?}", channels);
if channels.is_empty() {
println!("No channels found.");
} else {
println!("User Channels:");
for channel in channels.iter() {
println!("--------------------------------------------");
println!("Channel ID: {}", channel.channel_id);
println!("Channel Value: {}", Bitcoin::from_sats(channel.channel_value_sats));
// println!("Our Balance: {}", Bitcoin::from_sats(channel.outbound_capacity_msat / 1000));
// println!("Their Balance: {}", Bitcoin::from_sats(channel.inbound_capacity_msat / 1000));
println!("Channel Ready?: {}", channel.is_channel_ready);
}
println!("--------------------------------------------");
}
},
(Some("getinvoice"), [sats]) => {
if let Ok(sats_value) = sats.parse::<u64>() {
Expand Down

0 comments on commit 67578b0

Please sign in to comment.