@@ -1515,7 +1515,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1515
1515
SP::Target: SignerProvider,
1516
1516
{
1517
1517
let logger = WithContext::from(logger, Some(counterparty_node_id), Some(open_channel_fields.temporary_channel_id), None);
1518
- let announced_channel = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
1518
+ let announce_for_forwarding = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
1519
1519
1520
1520
let channel_value_satoshis = our_funding_satoshis.saturating_add(open_channel_fields.funding_satoshis);
1521
1521
@@ -1589,7 +1589,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1589
1589
// Convert things into internal flags and prep our state:
1590
1590
1591
1591
if config.channel_handshake_limits.force_announced_channel_preference {
1592
- if config.channel_handshake_config.announced_channel != announced_channel {
1592
+ if config.channel_handshake_config.announce_for_forwarding != announce_for_forwarding {
1593
1593
return Err(ChannelError::close("Peer tried to open channel but their announcement preference is different from ours".to_owned()));
1594
1594
}
1595
1595
}
@@ -1689,7 +1689,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1689
1689
1690
1690
config: LegacyChannelConfig {
1691
1691
options: config.channel_config.clone(),
1692
- announced_channel ,
1692
+ announce_for_forwarding ,
1693
1693
commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
1694
1694
},
1695
1695
@@ -1921,7 +1921,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1921
1921
1922
1922
config: LegacyChannelConfig {
1923
1923
options: config.channel_config.clone(),
1924
- announced_channel : config.channel_handshake_config.announced_channel ,
1924
+ announce_for_forwarding : config.channel_handshake_config.announce_for_forwarding ,
1925
1925
commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
1926
1926
},
1927
1927
@@ -2066,7 +2066,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
2066
2066
}
2067
2067
2068
2068
pub fn should_announce(&self) -> bool {
2069
- self.config.announced_channel
2069
+ self.config.announce_for_forwarding
2070
2070
}
2071
2071
2072
2072
pub fn is_outbound(&self) -> bool {
@@ -6920,7 +6920,7 @@ impl<SP: Deref> Channel<SP> where
6920
6920
fn get_channel_announcement<NS: Deref>(
6921
6921
&self, node_signer: &NS, chain_hash: ChainHash, user_config: &UserConfig,
6922
6922
) -> Result<msgs::UnsignedChannelAnnouncement, ChannelError> where NS::Target: NodeSigner {
6923
- if !self.context.config.announced_channel {
6923
+ if !self.context.config.announce_for_forwarding {
6924
6924
return Err(ChannelError::Ignore("Channel is not available for public announcements".to_owned()));
6925
6925
}
6926
6926
if !self.context.is_usable() {
@@ -7778,7 +7778,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
7778
7778
delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
7779
7779
htlc_basepoint: keys.htlc_basepoint.to_public_key(),
7780
7780
first_per_commitment_point,
7781
- channel_flags: if self.context.config.announced_channel {1} else {0},
7781
+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
7782
7782
shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
7783
7783
Some(script) => script.clone().into_inner(),
7784
7784
None => Builder::new().into_script(),
@@ -7943,8 +7943,8 @@ pub(super) fn channel_type_from_open_channel(
7943
7943
if channel_type.requires_unknown_bits_from(&our_supported_features) {
7944
7944
return Err(ChannelError::close("Channel Type contains unsupported features".to_owned()));
7945
7945
}
7946
- let announced_channel = if (common_fields.channel_flags & 1) == 1 { true } else { false };
7947
- if channel_type.requires_scid_privacy() && announced_channel {
7946
+ let announce_for_forwarding = if (common_fields.channel_flags & 1) == 1 { true } else { false };
7947
+ if channel_type.requires_scid_privacy() && announce_for_forwarding {
7948
7948
return Err(ChannelError::close("SCID Alias/Privacy Channel Type cannot be set on a public channel".to_owned()));
7949
7949
}
7950
7950
Ok(channel_type.clone())
@@ -8317,7 +8317,7 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
8317
8317
delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
8318
8318
htlc_basepoint: keys.htlc_basepoint.to_public_key(),
8319
8319
first_per_commitment_point,
8320
- channel_flags: if self.context.config.announced_channel {1} else {0},
8320
+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
8321
8321
shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
8322
8322
Some(script) => script.clone().into_inner(),
8323
8323
None => Builder::new().into_script(),
@@ -8496,7 +8496,7 @@ fn get_initial_channel_type(config: &UserConfig, their_features: &InitFeatures)
8496
8496
// available. If it's private, we first try `scid_privacy` as it provides better privacy
8497
8497
// with no other changes, and fall back to `only_static_remotekey`.
8498
8498
let mut ret = ChannelTypeFeatures::only_static_remote_key();
8499
- if !config.channel_handshake_config.announced_channel &&
8499
+ if !config.channel_handshake_config.announce_for_forwarding &&
8500
8500
config.channel_handshake_config.negotiate_scid_privacy &&
8501
8501
their_features.supports_scid_privacy() {
8502
8502
ret.set_scid_privacy_required();
@@ -8968,7 +8968,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
8968
8968
// Read the old serialization of the ChannelConfig from version 0.0.98.
8969
8969
config.as_mut().unwrap().options.forwarding_fee_proportional_millionths = Readable::read(reader)?;
8970
8970
config.as_mut().unwrap().options.cltv_expiry_delta = Readable::read(reader)?;
8971
- config.as_mut().unwrap().announced_channel = Readable::read(reader)?;
8971
+ config.as_mut().unwrap().announce_for_forwarding = Readable::read(reader)?;
8972
8972
config.as_mut().unwrap().commit_upfront_shutdown_pubkey = Readable::read(reader)?;
8973
8973
} else {
8974
8974
// Read the 8 bytes of backwards-compatibility ChannelConfig data.
@@ -10287,7 +10287,7 @@ mod tests {
10287
10287
10288
10288
let counterparty_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
10289
10289
let mut config = UserConfig::default();
10290
- config.channel_handshake_config.announced_channel = false;
10290
+ config.channel_handshake_config.announce_for_forwarding = false;
10291
10291
let mut chan = OutboundV1Channel::<&Keys>::new(&LowerBoundedFeeEstimator::new(&feeest), &&keys_provider, &&keys_provider, counterparty_node_id, &channelmanager::provided_init_features(&config), 10_000_000, 0, 42, &config, 0, 42, None, &*logger).unwrap(); // Nothing uses their network key in this test
10292
10292
chan.context.holder_dust_limit_satoshis = 546;
10293
10293
chan.context.counterparty_selected_channel_reserve_satoshis = Some(0); // Filled in in accept_channel
0 commit comments