]> git.bitcoin.ninja Git - ldk-sample/commitdiff
Display our local balance in addition to the available-for-send balance
authorMatt Corallo <git@bluematt.me>
Fri, 30 Jul 2021 16:21:06 +0000 (16:21 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 30 Jul 2021 16:31:25 +0000 (16:31 +0000)
src/cli.rs

index f8597e33a19439b94c4c7516bce42671fe8eda81..d4d7e9ed4263079d84f3e3e42d1efc269f8f5404 100644 (file)
@@ -462,6 +462,11 @@ fn list_channels(channel_manager: Arc<ChannelManager>) {
                }
                println!("\t\tis_confirmed_onchain: {},", chan_info.is_funding_locked);
                println!("\t\tchannel_value_satoshis: {},", chan_info.channel_value_satoshis);
+               println!(
+                       "\t\tlocal_balance_msat: {},",
+                       chan_info.outbound_capacity_msat
+                               + chan_info.unspendable_punishment_reserve.unwrap_or(0) * 1000
+               );
                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);