]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Rename ChannelDetails::is_live to is_usable 2021-05-more-chan-info
authorMatt Corallo <git@bluematt.me>
Thu, 6 May 2021 20:26:39 +0000 (20:26 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 6 May 2021 20:49:20 +0000 (20:49 +0000)
This matches is_usable_channels and slightly better captures the
meaning.

fuzz/src/router.rs
lightning/src/ln/channelmanager.rs
lightning/src/routing/router.rs

index 585ae9b354fbcfca12a1a4c4e754522b32030c37..f9a263cc3254556036bc4640d07f40a9df6179d4 100644 (file)
@@ -215,7 +215,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                                inbound_capacity_msat: 0,
                                                                is_outbound: true,
                                                                is_funding_locked: true,
-                                                               is_live: true,
+                                                               is_usable: true,
                                                                is_public: true,
                                                                outbound_capacity_msat: 0,
                                                                counterparty_forwarding_info: None,
index a970c52de6f22b762c648ce52a7ea0e0d74ba731..5441ab4b57013152b063359ef5dd7ba2d55f049e 100644 (file)
@@ -646,7 +646,7 @@ pub struct ChannelDetails {
        /// channel is not currently negotiating a shutdown.
        ///
        /// This is a strict superset of `is_funding_locked`.
-       pub is_live: bool,
+       pub is_usable: bool,
        /// True if this channel is (or will be) publicly-announced.
        pub is_public: bool,
        /// Information on the fees and requirements that the counterparty requires when forwarding
@@ -981,7 +981,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
                                        user_id: channel.get_user_id(),
                                        is_outbound: channel.is_outbound(),
                                        is_funding_locked: channel.is_usable(),
-                                       is_live: channel.is_live(),
+                                       is_usable: channel.is_live(),
                                        is_public: channel.should_announce(),
                                        counterparty_forwarding_info: channel.counterparty_forwarding_info(),
                                });
@@ -1005,8 +1005,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
        /// Gets the list of usable channels, in random order. Useful as an argument to
        /// get_route to ensure non-announced channels are used.
        ///
-       /// These are guaranteed to have their is_live value set to true, see the documentation for
-       /// ChannelDetails::is_live for more info on exactly what the criteria are.
+       /// These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
+       /// documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
+       /// are.
        pub fn list_usable_channels(&self) -> Vec<ChannelDetails> {
                // Note we use is_live here instead of usable which leads to somewhat confused
                // internal/external nomenclature, but that's ok cause that's probably what the user
index 87214b8f5f6b7fd9b7a3eeac79cd4cef8b9133d1..ca7f30e30631a9679938a6a7eec0ebf371adf8a4 100644 (file)
@@ -1635,7 +1635,7 @@ mod tests {
                        outbound_capacity_msat: 100000,
                        inbound_capacity_msat: 100000,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];
 
@@ -1955,7 +1955,7 @@ mod tests {
                        outbound_capacity_msat: 250_000_000,
                        inbound_capacity_msat: 0,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];
                let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], None, Some(&our_chans.iter().collect::<Vec<_>>()),  &Vec::new(), 100, 42, Arc::clone(&logger)).unwrap();
@@ -2005,7 +2005,7 @@ mod tests {
                        outbound_capacity_msat: 250_000_000,
                        inbound_capacity_msat: 0,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];
                let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], None, Some(&our_chans.iter().collect::<Vec<_>>()), &Vec::new(), 100, 42, Arc::clone(&logger)).unwrap();
@@ -2072,7 +2072,7 @@ mod tests {
                        outbound_capacity_msat: 250_000_000,
                        inbound_capacity_msat: 0,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];
                let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], None, Some(&our_chans.iter().collect::<Vec<_>>()), &Vec::new(), 100, 42, Arc::clone(&logger)).unwrap();
@@ -2211,7 +2211,7 @@ mod tests {
                        outbound_capacity_msat: 250_000_000,
                        inbound_capacity_msat: 0,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];
                let mut last_hops = last_hops(&nodes);
@@ -2342,7 +2342,7 @@ mod tests {
                        outbound_capacity_msat: 100000,
                        inbound_capacity_msat: 100000,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];
                let route = get_route(&source_node_id, &NetworkGraph::new(genesis_block(Network::Testnet).header.block_hash()), &target_node_id, None, Some(&our_chans.iter().collect::<Vec<_>>()), &last_hops.iter().collect::<Vec<_>>(), 100, 42, Arc::new(test_utils::TestLogger::new())).unwrap();
@@ -2476,7 +2476,7 @@ mod tests {
                        outbound_capacity_msat: 200_000_000,
                        inbound_capacity_msat: 0,
                        is_outbound: true, is_funding_locked: true,
-                       is_live: true, is_public: true,
+                       is_usable: true, is_public: true,
                        counterparty_forwarding_info: None,
                }];