is_outbound: true,
is_channel_ready: true,
is_usable: true,
- is_public: true,
+ is_announced: true,
balance_msat: 0,
outbound_capacity_msat: capacity.saturating_mul(1000),
next_outbound_htlc_limit_msat: capacity.saturating_mul(1000),
/// This is a strict superset of `is_channel_ready`.
pub is_usable: bool,
/// True if this channel is (or will be) publicly-announced.
- pub is_public: bool,
+ pub is_announced: bool,
/// The smallest value HTLC (in msat) we will accept, for this channel. This field
/// is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
pub inbound_htlc_minimum_msat: Option<u64>,
is_outbound: context.is_outbound(),
is_channel_ready: context.is_usable(),
is_usable: context.is_live(),
- is_public: context.should_announce(),
+ is_announced: context.should_announce(),
inbound_htlc_minimum_msat: Some(context.get_holder_htlc_minimum_msat()),
inbound_htlc_maximum_msat: context.get_holder_htlc_maximum_msat(),
config: Some(context.config()),
(26, self.is_outbound, required),
(28, self.is_channel_ready, required),
(30, self.is_usable, required),
- (32, self.is_public, required),
+ (32, self.is_announced, required),
(33, self.inbound_htlc_minimum_msat, option),
(35, self.inbound_htlc_maximum_msat, option),
(37, user_channel_id_high_opt, option),
(26, is_outbound, required),
(28, is_channel_ready, required),
(30, is_usable, required),
- (32, is_public, required),
+ (32, is_announced, required),
(33, inbound_htlc_minimum_msat, option),
(35, inbound_htlc_maximum_msat, option),
(37, user_channel_id_high_opt, option),
is_outbound: is_outbound.0.unwrap(),
is_channel_ready: is_channel_ready.0.unwrap(),
is_usable: is_usable.0.unwrap(),
- is_public: is_public.0.unwrap(),
+ is_announced: is_announced.0.unwrap(),
inbound_htlc_minimum_msat,
inbound_htlc_maximum_msat,
feerate_sat_per_1000_weight,
is_outbound: true,
is_channel_ready: false,
is_usable: true,
- is_public: false,
+ is_announced: false,
inbound_htlc_minimum_msat: Some(98),
inbound_htlc_maximum_msat: Some(983274),
config: Some(ChannelConfig::default()),
if chan.channel_id == as_channel_ready.channel_id {
assert!(!found_a);
found_a = true;
- assert!(!chan.is_public);
+ assert!(!chan.is_announced);
}
}
assert!(found_a);
if chan.channel_id == as_channel_ready.channel_id {
assert!(!found_b);
found_b = true;
- assert!(!chan.is_public);
+ assert!(!chan.is_announced);
}
}
assert!(found_b);
continue;
}
- if channel.is_public {
+ if channel.is_announced {
if channel.confirmations.is_some() && channel.confirmations < Some(7) {
// If we have a public channel, but it doesn't have enough confirmations to (yet)
// be in the public network graph (and have gotten a chance to propagate), include
let current_max_capacity = entry.get().inbound_capacity_msat;
// If this channel is public and the previous channel is not, ensure we replace the
// previous channel to avoid announcing non-public channels.
- let new_now_public = channel.is_public && !entry.get().is_public;
+ let new_now_public = channel.is_announced && !entry.get().is_announced;
// Decide whether we prefer the currently selected channel with the node to the new one,
// based on their inbound capacity.
let prefer_current = prefer_current_channel(min_inbound_capacity_msat, current_max_capacity,
// If the public-ness of the channel has not changed (in which case simply defer to
// `new_now_public), and this channel has more desirable inbound than the incumbent,
// prefer to include this channel.
- let new_channel_preferable = channel.is_public == entry.get().is_public && !prefer_current;
+ let new_channel_preferable = channel.is_announced == entry.get().is_announced && !prefer_current;
if new_now_public || new_channel_preferable {
log_trace!(logger,
// If we have a public channel, but it doesn't have enough confirmations to (yet)
// be in the public network graph (and have gotten a chance to propagate), include
// route hints but only for public channels to protect private channel privacy.
- channel.is_public
+ channel.is_announced
} else if online_min_capacity_channel_exists {
has_enough_capacity && channel.is_usable
} else if min_capacity_channel_exists && online_channel_exists {
log_trace!(logger, "Ignoring channel {} without enough capacity for invoice route hints",
&channel.channel_id);
} else {
- debug_assert!(!channel.is_usable || (has_pub_unconf_chan && !channel.is_public));
+ debug_assert!(!channel.is_usable || (has_pub_unconf_chan && !channel.is_announced));
log_trace!(logger, "Ignoring channel {} with disconnected peer",
&channel.channel_id);
}
#[inline]
pub fn globally_unique_short_channel_id(&self) -> Option<u64> {
match self {
- CandidateRouteHop::FirstHop(hop) => if hop.details.is_public { hop.details.short_channel_id } else { None },
+ CandidateRouteHop::FirstHop(hop) => if hop.details.is_announced { hop.details.short_channel_id } else { None },
CandidateRouteHop::PublicHop(hop) => Some(hop.short_channel_id),
CandidateRouteHop::PrivateHop(_) => None,
CandidateRouteHop::Blinded(_) => None,
true
} else if let CandidateRouteHop::FirstHop(first_hop) = &hop.candidate {
// If this is a first hop we also know if it's announced.
- first_hop.details.is_public
+ first_hop.details.is_announced
} else {
// If we sourced it any other way, we double-check the network graph to see if
// there are announced channels between the endpoints. If so, the hop might be
confirmations: None,
force_close_spend_delay: None,
is_outbound: true, is_channel_ready: true,
- is_usable: true, is_public: true,
+ is_usable: true, is_announced: true,
inbound_htlc_minimum_msat: None,
inbound_htlc_maximum_msat: None,
config: None,
is_outbound: true,
is_channel_ready: true,
is_usable: true,
- is_public: true,
+ is_announced: true,
inbound_htlc_minimum_msat: None,
inbound_htlc_maximum_msat: None,
config: None,