diff --git a/examples/3l-node/cli.rs b/examples/3l-node/cli.rs index b347a1f8..107fd132 100644 --- a/examples/3l-node/cli.rs +++ b/examples/3l-node/cli.rs @@ -349,14 +349,6 @@ fn node_info(node: &LightningNode) { "On-Chain balance: {}", amount_to_string(node_info.onchain_balance) ); - println!( - " Number of channels: {}", - node_info.channels_info.num_channels - ); - println!( - "Number of usable channels: {}", - node_info.channels_info.num_usable_channels - ); println!( " Local balance: {}", amount_to_string(node_info.channels_info.local_balance) @@ -369,10 +361,6 @@ fn node_info(node: &LightningNode) { " Outbound capacity: {}", amount_to_string(node_info.channels_info.outbound_capacity) ); - println!( - " Capacity of all channels: {}", - amount_to_string(node_info.channels_info.total_channel_capacities) - ); } fn wallet_pubkey_id(node: &LightningNode) { diff --git a/src/lib.rs b/src/lib.rs index f1419002..e0aeab61 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,14 +100,9 @@ pub struct NodeInfo { } pub struct ChannelsInfo { - // This field will currently always be 0 until Breez SDK exposes more detailed channel information https://github.com/breez/breez-sdk/issues/421 - pub num_channels: u16, - // This field will currently always be 0 until Breez SDK exposes more detailed channel information https://github.com/breez/breez-sdk/issues/421 - pub num_usable_channels: u16, pub local_balance: Amount, pub inbound_capacity: Amount, pub outbound_capacity: Amount, - pub total_channel_capacities: Amount, } #[derive(PartialEq, Eq, Debug, TryFromPrimitive, Clone)] @@ -403,12 +398,9 @@ impl LightningNode { peers: node_state.connected_peers, onchain_balance: node_state.onchain_balance_msat.to_amount_down(&rate), channels_info: ChannelsInfo { - num_channels: 0, - num_usable_channels: 0, local_balance: node_state.channels_balance_msat.to_amount_down(&rate), inbound_capacity: node_state.inbound_liquidity_msats.to_amount_down(&rate), outbound_capacity: node_state.max_payable_msat.to_amount_down(&rate), - total_channel_capacities: 0.to_amount_down(&rate), }, }) } diff --git a/src/lipalightninglib.udl b/src/lipalightninglib.udl index afd9dd9e..5959bbe4 100644 --- a/src/lipalightninglib.udl +++ b/src/lipalightninglib.udl @@ -274,14 +274,8 @@ dictionary NodeInfo { }; dictionary ChannelsInfo { - // This field will currently always be 0 until Breez SDK exposes more detailed channel information https://github.com/breez/breez-sdk/issues/421 - u16 num_channels; // Number of currently open channels. - // This field will currently always be 0 until Breez SDK exposes more detailed channel information https://github.com/breez/breez-sdk/issues/421 - u16 num_usable_channels; // Number of usable channels. E.g. if a peer if offline, channels with that peer won't be usable. - Amount local_balance; // The balance of the local node. Please keep in mind not all of this balance is spendable - // due to Lightning channel reserves - // This field will currently always be 0 until Breez SDK exposes more detailed channel information https://github.com/breez/breez-sdk/issues/421 - Amount total_channel_capacities; // Total capacity of all usable channels of the node + // The balance of the local node + Amount local_balance; // Capacity the node can actually receive. // It excludes non usable channels, pending HTLCs, channels reserves, etc. diff --git a/tests/node_info_test.rs b/tests/node_info_test.rs index 9efd51de..f0a5608a 100644 --- a/tests/node_info_test.rs +++ b/tests/node_info_test.rs @@ -17,10 +17,6 @@ fn test_get_node_info() { PublicKey::from_str(&*node_info.node_pubkey).is_ok(), "Node public key is not valid" ); - assert!( - node_info.channels_info.num_channels >= node_info.channels_info.num_usable_channels, - "Number of channels must be greater or equal to number of usable channels" - ); assert!( node_info.channels_info.local_balance.sats < 21_000_000 * 100_000_000, "Node must not hold more than 21 million BTC on lightning"