Skip to content

Commit 49ff0b2

Browse files
committed
Rename ChannelDetails::is_live to is_usable
This matches is_usable_channels and slightly better captures the meaning.
1 parent 3a273fc commit 49ff0b2

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

fuzz/src/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
215215
inbound_capacity_msat: 0,
216216
is_outbound: true,
217217
is_funding_locked: true,
218-
is_live: true,
218+
is_usable: true,
219219
is_public: true,
220220
outbound_capacity_msat: 0,
221221
counterparty_forwarding_info: None,

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ pub struct ChannelDetails {
646646
/// channel is not currently negotiating a shutdown.
647647
///
648648
/// This is a strict superset of `is_funding_locked`.
649-
pub is_live: bool,
649+
pub is_usable: bool,
650650
/// True if this channel is (or will be) publicly-announced.
651651
pub is_public: bool,
652652
/// 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
981981
user_id: channel.get_user_id(),
982982
is_outbound: channel.is_outbound(),
983983
is_funding_locked: channel.is_usable(),
984-
is_live: channel.is_live(),
984+
is_usable: channel.is_live(),
985985
is_public: channel.should_announce(),
986986
counterparty_forwarding_info: channel.counterparty_forwarding_info(),
987987
});
@@ -1005,8 +1005,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
10051005
/// Gets the list of usable channels, in random order. Useful as an argument to
10061006
/// get_route to ensure non-announced channels are used.
10071007
///
1008-
/// These are guaranteed to have their is_live value set to true, see the documentation for
1009-
/// ChannelDetails::is_live for more info on exactly what the criteria are.
1008+
/// These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
1009+
/// documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
1010+
/// are.
10101011
pub fn list_usable_channels(&self) -> Vec<ChannelDetails> {
10111012
// Note we use is_live here instead of usable which leads to somewhat confused
10121013
// internal/external nomenclature, but that's ok cause that's probably what the user

lightning/src/routing/router.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ mod tests {
16351635
outbound_capacity_msat: 100000,
16361636
inbound_capacity_msat: 100000,
16371637
is_outbound: true, is_funding_locked: true,
1638-
is_live: true, is_public: true,
1638+
is_usable: true, is_public: true,
16391639
counterparty_forwarding_info: None,
16401640
}];
16411641

@@ -1955,7 +1955,7 @@ mod tests {
19551955
outbound_capacity_msat: 250_000_000,
19561956
inbound_capacity_msat: 0,
19571957
is_outbound: true, is_funding_locked: true,
1958-
is_live: true, is_public: true,
1958+
is_usable: true, is_public: true,
19591959
counterparty_forwarding_info: None,
19601960
}];
19611961
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 {
20052005
outbound_capacity_msat: 250_000_000,
20062006
inbound_capacity_msat: 0,
20072007
is_outbound: true, is_funding_locked: true,
2008-
is_live: true, is_public: true,
2008+
is_usable: true, is_public: true,
20092009
counterparty_forwarding_info: None,
20102010
}];
20112011
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 {
20722072
outbound_capacity_msat: 250_000_000,
20732073
inbound_capacity_msat: 0,
20742074
is_outbound: true, is_funding_locked: true,
2075-
is_live: true, is_public: true,
2075+
is_usable: true, is_public: true,
20762076
counterparty_forwarding_info: None,
20772077
}];
20782078
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 {
22112211
outbound_capacity_msat: 250_000_000,
22122212
inbound_capacity_msat: 0,
22132213
is_outbound: true, is_funding_locked: true,
2214-
is_live: true, is_public: true,
2214+
is_usable: true, is_public: true,
22152215
counterparty_forwarding_info: None,
22162216
}];
22172217
let mut last_hops = last_hops(&nodes);
@@ -2342,7 +2342,7 @@ mod tests {
23422342
outbound_capacity_msat: 100000,
23432343
inbound_capacity_msat: 100000,
23442344
is_outbound: true, is_funding_locked: true,
2345-
is_live: true, is_public: true,
2345+
is_usable: true, is_public: true,
23462346
counterparty_forwarding_info: None,
23472347
}];
23482348
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 {
24762476
outbound_capacity_msat: 200_000_000,
24772477
inbound_capacity_msat: 0,
24782478
is_outbound: true, is_funding_locked: true,
2479-
is_live: true, is_public: true,
2479+
is_usable: true, is_public: true,
24802480
counterparty_forwarding_info: None,
24812481
}];
24822482

0 commit comments

Comments
 (0)