.. we rename the flag configuring whether we announce a channel or not.
let mut config = UserConfig::default();
config.channel_config.forwarding_fee_proportional_millionths = 0;
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
if anchors {
config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
config.manually_accept_inbound_channels = true;
let mut config = UserConfig::default();
config.channel_config.forwarding_fee_proportional_millionths = 0;
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
if anchors {
config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
config.manually_accept_inbound_channels = true;
SP::Target: SignerProvider,
{
let logger = WithContext::from(logger, Some(counterparty_node_id), Some(open_channel_fields.temporary_channel_id), None);
- let announced_channel = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
+ let announce_for_forwarding = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
let channel_value_satoshis = our_funding_satoshis.saturating_add(open_channel_fields.funding_satoshis);
// Convert things into internal flags and prep our state:
if config.channel_handshake_limits.force_announced_channel_preference {
- if config.channel_handshake_config.announced_channel != announced_channel {
+ if config.channel_handshake_config.announce_for_forwarding != announce_for_forwarding {
return Err(ChannelError::close("Peer tried to open channel but their announcement preference is different from ours".to_owned()));
}
}
config: LegacyChannelConfig {
options: config.channel_config.clone(),
- announced_channel,
+ announce_for_forwarding,
commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
},
config: LegacyChannelConfig {
options: config.channel_config.clone(),
- announced_channel: config.channel_handshake_config.announced_channel,
+ announce_for_forwarding: config.channel_handshake_config.announce_for_forwarding,
commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
},
}
pub fn should_announce(&self) -> bool {
- self.config.announced_channel
+ self.config.announce_for_forwarding
}
pub fn is_outbound(&self) -> bool {
fn get_channel_announcement<NS: Deref>(
&self, node_signer: &NS, chain_hash: ChainHash, user_config: &UserConfig,
) -> Result<msgs::UnsignedChannelAnnouncement, ChannelError> where NS::Target: NodeSigner {
- if !self.context.config.announced_channel {
+ if !self.context.config.announce_for_forwarding {
return Err(ChannelError::Ignore("Channel is not available for public announcements".to_owned()));
}
if !self.context.is_usable() {
delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
htlc_basepoint: keys.htlc_basepoint.to_public_key(),
first_per_commitment_point,
- channel_flags: if self.context.config.announced_channel {1} else {0},
+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
Some(script) => script.clone().into_inner(),
None => Builder::new().into_script(),
if channel_type.requires_unknown_bits_from(&our_supported_features) {
return Err(ChannelError::close("Channel Type contains unsupported features".to_owned()));
}
- let announced_channel = if (common_fields.channel_flags & 1) == 1 { true } else { false };
- if channel_type.requires_scid_privacy() && announced_channel {
+ let announce_for_forwarding = if (common_fields.channel_flags & 1) == 1 { true } else { false };
+ if channel_type.requires_scid_privacy() && announce_for_forwarding {
return Err(ChannelError::close("SCID Alias/Privacy Channel Type cannot be set on a public channel".to_owned()));
}
Ok(channel_type.clone())
delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
htlc_basepoint: keys.htlc_basepoint.to_public_key(),
first_per_commitment_point,
- channel_flags: if self.context.config.announced_channel {1} else {0},
+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
Some(script) => script.clone().into_inner(),
None => Builder::new().into_script(),
// available. If it's private, we first try `scid_privacy` as it provides better privacy
// with no other changes, and fall back to `only_static_remotekey`.
let mut ret = ChannelTypeFeatures::only_static_remote_key();
- if !config.channel_handshake_config.announced_channel &&
+ if !config.channel_handshake_config.announce_for_forwarding &&
config.channel_handshake_config.negotiate_scid_privacy &&
their_features.supports_scid_privacy() {
ret.set_scid_privacy_required();
// Read the old serialization of the ChannelConfig from version 0.0.98.
config.as_mut().unwrap().options.forwarding_fee_proportional_millionths = Readable::read(reader)?;
config.as_mut().unwrap().options.cltv_expiry_delta = Readable::read(reader)?;
- config.as_mut().unwrap().announced_channel = Readable::read(reader)?;
+ config.as_mut().unwrap().announce_for_forwarding = Readable::read(reader)?;
config.as_mut().unwrap().commit_upfront_shutdown_pubkey = Readable::read(reader)?;
} else {
// Read the 8 bytes of backwards-compatibility ChannelConfig data.
let counterparty_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = false;
+ config.channel_handshake_config.announce_for_forwarding = false;
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
chan.context.holder_dust_limit_satoshis = 546;
chan.context.counterparty_selected_channel_reserve_satoshis = Some(0); // Filled in in accept_channel
pub fn create_unannounced_chan_between_nodes_with_value<'a, 'b, 'c, 'd>(nodes: &'a Vec<Node<'b, 'c, 'd>>, a: usize, b: usize, channel_value: u64, push_msat: u64) -> (msgs::ChannelReady, Transaction) {
let mut no_announce_cfg = test_default_channel_config();
- no_announce_cfg.channel_handshake_config.announced_channel = false;
+ no_announce_cfg.channel_handshake_config.announce_for_forwarding = false;
nodes[a].node.create_channel(nodes[b].node.get_our_node_id(), channel_value, push_msat, 42, None, Some(no_announce_cfg)).unwrap();
let open_channel = get_event_msg!(nodes[a], MessageSendEvent::SendOpenChannel, nodes[b].node.get_our_node_id());
nodes[b].node.handle_open_channel(&nodes[a].node.get_our_node_id(), &open_channel);
// Set cltv_expiry_delta slightly lower to keep the final CLTV values inside one byte in our
// tests so that our script-length checks don't fail (see ACCEPTED_HTLC_SCRIPT_WEIGHT).
default_config.channel_config.cltv_expiry_delta = MIN_CLTV_EXPIRY_DELTA;
- default_config.channel_handshake_config.announced_channel = true;
+ default_config.channel_handshake_config.announce_for_forwarding = true;
default_config.channel_handshake_limits.force_announced_channel_preference = false;
// When most of our tests were written, the default HTLC minimum was fixed at 1000.
// It now defaults to 1, so we simply set it to the expected value here.
fn test_justice_tx_htlc_timeout() {
// Test justice txn built on revoked HTLC-Timeout tx, against both sides
let mut alice_config = test_default_channel_config();
- alice_config.channel_handshake_config.announced_channel = true;
+ alice_config.channel_handshake_config.announce_for_forwarding = true;
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
alice_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 5;
let mut bob_config = test_default_channel_config();
- bob_config.channel_handshake_config.announced_channel = true;
+ bob_config.channel_handshake_config.announce_for_forwarding = true;
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
bob_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 3;
let user_cfgs = [Some(alice_config), Some(bob_config)];
fn test_justice_tx_htlc_success() {
// Test justice txn built on revoked HTLC-Success tx, against both sides
let mut alice_config = test_default_channel_config();
- alice_config.channel_handshake_config.announced_channel = true;
+ alice_config.channel_handshake_config.announce_for_forwarding = true;
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
alice_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 5;
let mut bob_config = test_default_channel_config();
- bob_config.channel_handshake_config.announced_channel = true;
+ bob_config.channel_handshake_config.announce_for_forwarding = true;
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
bob_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 3;
let user_cfgs = [Some(alice_config), Some(bob_config)];
// 2. MUST be set to less than or equal to the `max_htlc_value_in_flight_msat` received from the peer.
let mut config_30_percent = UserConfig::default();
- config_30_percent.channel_handshake_config.announced_channel = true;
+ config_30_percent.channel_handshake_config.announce_for_forwarding = true;
config_30_percent.channel_handshake_config.max_inbound_htlc_value_in_flight_percent_of_channel = 30;
let mut config_50_percent = UserConfig::default();
- config_50_percent.channel_handshake_config.announced_channel = true;
+ config_50_percent.channel_handshake_config.announce_for_forwarding = true;
config_50_percent.channel_handshake_config.max_inbound_htlc_value_in_flight_percent_of_channel = 50;
let mut config_95_percent = UserConfig::default();
- config_95_percent.channel_handshake_config.announced_channel = true;
+ config_95_percent.channel_handshake_config.announce_for_forwarding = true;
config_95_percent.channel_handshake_config.max_inbound_htlc_value_in_flight_percent_of_channel = 95;
let mut config_100_percent = UserConfig::default();
- config_100_percent.channel_handshake_config.announced_channel = true;
+ config_100_percent.channel_handshake_config.announce_for_forwarding = true;
config_100_percent.channel_handshake_config.max_inbound_htlc_value_in_flight_percent_of_channel = 100;
let chanmon_cfgs = create_chanmon_cfgs(4);
// `msgs::ChannelUpdate` is never handled for the node(s). As the `msgs::ChannelUpdate`
// is never handled, the `channel.counterparty.forwarding_info` is never assigned.
let mut private_chan_cfg = UserConfig::default();
- private_chan_cfg.channel_handshake_config.announced_channel = false;
+ private_chan_cfg.channel_handshake_config.announce_for_forwarding = false;
let temporary_channel_id = nodes[2].node.create_channel(nodes[0].node.get_our_node_id(), 1_000_000, 500_000_000, 42, None, Some(private_chan_cfg)).unwrap();
let open_channel = get_event_msg!(nodes[2], MessageSendEvent::SendOpenChannel, nodes[0].node.get_our_node_id());
nodes[0].node.handle_open_channel(&nodes[2].node.get_our_node_id(), &open_channel);
// `msgs::ChannelUpdate` is never handled for the node(s). As the `msgs::ChannelUpdate`
// is never handled, the `channel.counterparty.forwarding_info` is never assigned.
let mut private_chan_cfg = UserConfig::default();
- private_chan_cfg.channel_handshake_config.announced_channel = false;
+ private_chan_cfg.channel_handshake_config.announce_for_forwarding = false;
let temporary_channel_id = nodes[1].node.create_channel(nodes[3].node.get_our_node_id(), 1_000_000, 500_000_000, 42, None, Some(private_chan_cfg)).unwrap();
let open_channel = get_event_msg!(nodes[1], MessageSendEvent::SendOpenChannel, nodes[3].node.get_our_node_id());
nodes[3].node.handle_open_channel(&nodes[1].node.get_our_node_id(), &open_channel);
let mut chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let mut anchors_config = test_default_channel_config();
- anchors_config.channel_handshake_config.announced_channel = true;
+ anchors_config.channel_handshake_config.announce_for_forwarding = true;
anchors_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
anchors_config.manually_accept_inbound_channels = true;
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(anchors_config), Some(anchors_config)]);
let bob_chain_monitor;
let mut anchors_config = test_default_channel_config();
- anchors_config.channel_handshake_config.announced_channel = true;
+ anchors_config.channel_handshake_config.announce_for_forwarding = true;
anchors_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
anchors_config.manually_accept_inbound_channels = true;
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(anchors_config), Some(anchors_config)]);
// Channel::get_counterparty_htlc_minimum_msat().
let mut node_2_cfg: UserConfig = test_default_channel_config();
node_2_cfg.channel_handshake_config.our_htlc_minimum_msat = 2000;
- node_2_cfg.channel_handshake_config.announced_channel = true;
+ node_2_cfg.channel_handshake_config.announce_for_forwarding = true;
node_2_cfg.channel_handshake_limits.force_announced_channel_preference = false;
// When this test was written, the default base fee floated based on the HTLC count.
claim_payment(&nodes[0], &[&nodes[1], &nodes[2]], payment_preimage);
}
-fn do_test_onion_failure_stale_channel_update(announced_channel: bool) {
+fn do_test_onion_failure_stale_channel_update(announce_for_forwarding: bool) {
// Create a network of three nodes and two channels connecting them. We'll be updating the
// HTLC relay policy of the second channel, causing forwarding failures at the first hop.
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = announced_channel;
+ config.channel_handshake_config.announce_for_forwarding = announce_for_forwarding;
config.channel_handshake_limits.force_announced_channel_preference = false;
- config.accept_forwards_to_priv_channels = !announced_channel;
+ config.accept_forwards_to_priv_channels = !announce_for_forwarding;
config.channel_config.max_dust_htlc_exposure = MaxDustHTLCExposure::FeeRateMultiplier(5_000_000 / 253);
let chanmon_cfgs = create_chanmon_cfgs(3);
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
let other_channel = create_chan_between_nodes(
&nodes[0], &nodes[1],
);
- let channel_to_update = if announced_channel {
+ let channel_to_update = if announce_for_forwarding {
let channel = create_announced_chan_between_nodes(
&nodes, 1, 2,
);
// A test payment should succeed as the ChannelConfig has not been changed yet.
const PAYMENT_AMT: u64 = 40000;
- let (route, payment_hash, payment_preimage, payment_secret) = if announced_channel {
+ let (route, payment_hash, payment_preimage, payment_secret) = if announce_for_forwarding {
get_route_and_payment_hash!(nodes[0], nodes[2], PAYMENT_AMT)
} else {
let hop_hints = vec![RouteHint(vec![RouteHintHop {
}
let new_update = match &events[0] {
MessageSendEvent::BroadcastChannelUpdate { msg } => {
- assert!(announced_channel);
+ assert!(announce_for_forwarding);
msg.clone()
},
MessageSendEvent::SendChannelUpdate { node_id, msg } => {
assert_eq!(node_id, channel_to_update_counterparty);
- assert!(!announced_channel);
+ assert!(!announce_for_forwarding);
msg.clone()
},
_ => panic!("expected Broadcast/SendChannelUpdate event"),
receiver_config.channel_config.max_dust_htlc_exposure =
if multiplier_dust_limit { MaxDustHTLCExposure::FeeRateMultiplier(2) }
else { MaxDustHTLCExposure::FixedLimitMsat(max_dust_exposure) };
- receiver_config.channel_handshake_config.announced_channel = true;
+ receiver_config.channel_handshake_config.announce_for_forwarding = true;
let chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
// tests that we properly send one in that case.
let mut alice_config = UserConfig::default();
alice_config.channel_handshake_config.minimum_depth = 1;
- alice_config.channel_handshake_config.announced_channel = true;
+ alice_config.channel_handshake_config.announce_for_forwarding = true;
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
alice_config.channel_config.max_dust_htlc_exposure = MaxDustHTLCExposure::FeeRateMultiplier(5_000_000 / 253);
let mut bob_config = UserConfig::default();
bob_config.channel_handshake_config.minimum_depth = 1;
- bob_config.channel_handshake_config.announced_channel = true;
+ bob_config.channel_handshake_config.announce_for_forwarding = true;
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
bob_config.channel_config.max_dust_htlc_exposure = MaxDustHTLCExposure::FeeRateMultiplier(5_000_000 / 253);
let chanmon_cfgs = create_chanmon_cfgs(2);
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
let mut scid_privacy_cfg = test_default_channel_config();
- scid_privacy_cfg.channel_handshake_config.announced_channel = true;
+ scid_privacy_cfg.channel_handshake_config.announce_for_forwarding = true;
scid_privacy_cfg.channel_handshake_config.negotiate_scid_privacy = true;
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100000, 10001, 42, None, Some(scid_privacy_cfg)).unwrap();
let mut open_channel = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
let mut scid_privacy_cfg = test_default_channel_config();
- scid_privacy_cfg.channel_handshake_config.announced_channel = false;
+ scid_privacy_cfg.channel_handshake_config.announce_for_forwarding = false;
scid_privacy_cfg.channel_handshake_config.negotiate_scid_privacy = true;
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100000, 10001, 42, None, Some(scid_privacy_cfg)).unwrap();
create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1_000_000, 0);
let mut no_announce_cfg = test_default_channel_config();
- no_announce_cfg.channel_handshake_config.announced_channel = false;
+ no_announce_cfg.channel_handshake_config.announce_for_forwarding = false;
no_announce_cfg.channel_handshake_config.negotiate_scid_privacy = true;
nodes[1].node.create_channel(nodes[2].node.get_our_node_id(), 100_000, 10_000, 42, None, Some(no_announce_cfg)).unwrap();
let mut open_channel = get_event_msg!(nodes[1], MessageSendEvent::SendOpenChannel, nodes[2].node.get_our_node_id());
create_announced_chan_between_nodes_with_value(&nodes, 1, 2, 1_000_000, 0);
- chan_config.channel_handshake_config.announced_channel = false;
+ chan_config.channel_handshake_config.announce_for_forwarding = false;
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100000, 10001, 42, None, Some(chan_config)).unwrap();
let open_channel = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
let error_message = "Channel force-closed";
// This is the default but we force it on anyway
- chan_config.channel_handshake_config.announced_channel = true;
+ chan_config.channel_handshake_config.announce_for_forwarding = true;
open_zero_conf_channel(&nodes[0], &nodes[1], Some(chan_config));
// We can use the channel immediately, but won't generate a channel_update until we get confs
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
// This is the default but we force it on anyway
- chan_config.channel_handshake_config.announced_channel = true;
+ chan_config.channel_handshake_config.announce_for_forwarding = true;
let (tx, ..) = open_zero_conf_channel(&nodes[0], &nodes[1], Some(chan_config));
// We can use the channel immediately, but we can't announce it until we get 6+ confirmations
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
// This is the default but we force it on anyway
- chan_config.channel_handshake_config.announced_channel = true;
+ chan_config.channel_handshake_config.announce_for_forwarding = true;
let (tx, ..) = open_zero_conf_channel(&nodes[0], &nodes[1], Some(chan_config));
// We can use the channel immediately, but we can't announce it until we get 6+ confirmations
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
// This is the default but we force it on anyway
- chan_config.channel_handshake_config.announced_channel = true;
+ chan_config.channel_handshake_config.announce_for_forwarding = true;
let (tx, ..) = open_zero_conf_channel(&nodes[0], &nodes[1], Some(chan_config));
// We can use the channel immediately, but we can't announce it until we get 6+ confirmations
// enforce it at shutdown message
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
config.channel_handshake_config.commit_upfront_shutdown_pubkey = false;
let user_cfgs = [None, Some(config), None];
#[test]
fn test_segwit_v0_shutdown_script() {
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
config.channel_handshake_config.commit_upfront_shutdown_pubkey = false;
let user_cfgs = [None, Some(config), None];
#[test]
fn test_anysegwit_shutdown_script() {
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
config.channel_handshake_config.commit_upfront_shutdown_pubkey = false;
let user_cfgs = [None, Some(config), None];
#[test]
fn test_unsupported_anysegwit_shutdown_script() {
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
config.channel_handshake_config.commit_upfront_shutdown_pubkey = false;
let user_cfgs = [None, Some(config), None];
#[test]
fn test_invalid_shutdown_script() {
let mut config = UserConfig::default();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
config.channel_handshake_config.commit_upfront_shutdown_pubkey = false;
let user_cfgs = [None, Some(config), None];
#[test]
fn test_user_shutdown_script() {
let mut config = test_default_channel_config();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
config.channel_handshake_config.commit_upfront_shutdown_pubkey = false;
let user_cfgs = [None, Some(config), None];
#[test]
fn test_already_set_user_shutdown_script() {
let mut config = test_default_channel_config();
- config.channel_handshake_config.announced_channel = true;
+ config.channel_handshake_config.announce_for_forwarding = true;
config.channel_handshake_limits.force_announced_channel_preference = false;
let user_cfgs = [None, Some(config), None];
let chanmon_cfgs = create_chanmon_cfgs(3);
/// private channel without that option.
///
/// Ignored if the channel is negotiated to be announced, see
- /// [`ChannelHandshakeConfig::announced_channel`] and
+ /// [`ChannelHandshakeConfig::announce_for_forwarding`] and
/// [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
///
/// Default value: `false` (This value is likely to change to `true` in the future.)
/// channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
///
/// Default value: `false`
- pub announced_channel: bool,
+ pub announce_for_forwarding: bool,
/// When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
/// supports it, they will then enforce the mutual-close output to us matches what we provided
/// at intialization, preventing us from closing to an alternate pubkey.
our_htlc_minimum_msat: 1,
max_inbound_htlc_value_in_flight_percent_of_channel: 10,
negotiate_scid_privacy: false,
- announced_channel: false,
+ announce_for_forwarding: false,
commit_upfront_shutdown_pubkey: true,
their_channel_reserve_proportional_millionths: 10_000,
negotiate_anchors_zero_fee_htlc_tx: false,
our_htlc_minimum_msat: Readable::read(reader)?,
max_inbound_htlc_value_in_flight_percent_of_channel: Readable::read(reader)?,
negotiate_scid_privacy: Readable::read(reader)?,
- announced_channel: Readable::read(reader)?,
+ announce_for_forwarding: Readable::read(reader)?,
commit_upfront_shutdown_pubkey: Readable::read(reader)?,
their_channel_reserve_proportional_millionths: Readable::read(reader)?,
negotiate_anchors_zero_fee_htlc_tx: Readable::read(reader)?,
/// Default value: `true`
pub trust_own_funding_0conf: bool,
/// Set to force an incoming channel to match our announced channel preference in
- /// [`ChannelHandshakeConfig::announced_channel`].
+ /// [`ChannelHandshakeConfig::announce_for_forwarding`].
///
/// For a node which is not online reliably, this should be set to true and
- /// [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+ /// [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public)
/// channels will ever be opened.
///
/// Default value: `true`
}
/// Legacy version of [`ChannelConfig`] that stored the static
-/// [`ChannelHandshakeConfig::announced_channel`] and
+/// [`ChannelHandshakeConfig::announce_for_forwarding`] and
/// [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`] fields.
#[derive(Copy, Clone, Debug)]
pub(crate) struct LegacyChannelConfig {
pub(crate) options: ChannelConfig,
- /// Deprecated but may still be read from. See [`ChannelHandshakeConfig::announced_channel`] to
+ /// Deprecated but may still be read from. See [`ChannelHandshakeConfig::announce_for_forwarding`] to
/// set this when opening/accepting a channel.
- pub(crate) announced_channel: bool,
+ pub(crate) announce_for_forwarding: bool,
/// Deprecated but may still be read from. See
/// [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`] to set this when
/// opening/accepting a channel.
fn default() -> Self {
Self {
options: ChannelConfig::default(),
- announced_channel: false,
+ announce_for_forwarding: false,
commit_upfront_shutdown_pubkey: true,
}
}
(1, max_dust_htlc_exposure_msat_fixed_limit, required),
(2, self.options.cltv_expiry_delta, required),
(3, self.options.force_close_avoidance_max_fee_satoshis, (default_value, 1000)),
- (4, self.announced_channel, required),
+ (4, self.announce_for_forwarding, required),
(5, self.options.max_dust_htlc_exposure, required),
(6, self.commit_upfront_shutdown_pubkey, required),
(8, self.options.forwarding_fee_base_msat, required),
let mut max_dust_htlc_exposure_msat_fixed_limit = None;
let mut cltv_expiry_delta = 0;
let mut force_close_avoidance_max_fee_satoshis = 1000;
- let mut announced_channel = false;
+ let mut announce_for_forwarding = false;
let mut commit_upfront_shutdown_pubkey = false;
let mut forwarding_fee_base_msat = 0;
let mut max_dust_htlc_exposure_enum = None;
(1, max_dust_htlc_exposure_msat_fixed_limit, option),
(2, cltv_expiry_delta, required),
(3, force_close_avoidance_max_fee_satoshis, (default_value, 1000u64)),
- (4, announced_channel, required),
+ (4, announce_for_forwarding, required),
(5, max_dust_htlc_exposure_enum, option),
(6, commit_upfront_shutdown_pubkey, required),
(8, forwarding_fee_base_msat, required),
forwarding_fee_base_msat,
accept_underpaying_htlcs: false,
},
- announced_channel,
+ announce_for_forwarding,
commit_upfront_shutdown_pubkey,
})
}
/// node which is not online reliably.
///
/// For nodes which are not online reliably, you should set all channels to *not* be announced
- /// (using [`ChannelHandshakeConfig::announced_channel`] and
+ /// (using [`ChannelHandshakeConfig::announce_for_forwarding`] and
/// [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to
/// ensure you are not exposed to any forwarding risk.
///