From 4ee09b08468194b2351f65c4d47dfd97d80854f8 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 5 May 2021 18:43:38 +0000 Subject: [PATCH] Print more clear information about channel state in listchannels User feedback found `channel_can_send_payments` confusing on its own, and now that we have an upstream `is_confirmed` field, print that. Further, it is useful to have an explicit txid field, even if if is basically duplicative with channel_id. --- src/cli.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index f762fe5..9a0227c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -424,19 +424,22 @@ fn list_channels(channel_manager: Arc) { println!(""); println!("\t{{"); println!("\t\tchannel_id: {},", hex_utils::hex_str(&chan_info.channel_id[..])); + if let Some(funding_txo) = chan_info.funding_txo { + println!("\t\tfunding_txid: {},", funding_txo.txid); + } println!( "\t\tpeer_pubkey: {},", hex_utils::hex_str(&chan_info.remote_network_id.serialize()) ); - let mut pending_channel = false; - match chan_info.short_channel_id { - Some(id) => println!("\t\tshort_channel_id: {},", id), - None => { - pending_channel = true; - } + if let Some(id) = chan_info.short_channel_id { + println!("\t\tshort_channel_id: {},", id); } - println!("\t\tpending_open: {},", pending_channel); + println!("\t\tis_confirmed_onchain: {},", chan_info.is_funding_locked); println!("\t\tchannel_value_satoshis: {},", chan_info.channel_value_satoshis); + if chan_info.is_usable { + println!("\t\tavailable_balance_for_send_msat: {},", chan_info.outbound_capacity_msat); + println!("\t\tavailable_balance_for_recv_msat: {},", chan_info.inbound_capacity_msat); + } println!("\t\tchannel_can_send_payments: {},", chan_info.is_usable); println!("\t}},"); } -- 2.39.5