@@ -2640,11 +2640,11 @@ where
26402640 /// will be accepted on the given channel, and after additional timeout/the closing of all
26412641 /// pending HTLCs, the channel will be closed on chain.
26422642 ///
2643- /// * If we are the channel initiator, we will pay between our [`Background `] and
2644- /// [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
2645- /// estimate.
2643+ /// * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum `] and
2644+ /// [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
2645+ /// fee estimate.
26462646 /// * If our counterparty is the channel initiator, we will require a channel closing
2647- /// transaction feerate of at least our [`Background `] feerate or the feerate which
2647+ /// transaction feerate of at least our [`ChannelCloseMinimum `] feerate or the feerate which
26482648 /// would appear on a force-closure transaction, whichever is lower. We will allow our
26492649 /// counterparty to pay as much fee as they'd like, however.
26502650 ///
@@ -2656,8 +2656,8 @@ where
26562656 /// channel.
26572657 ///
26582658 /// [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
2659- /// [`Background `]: crate::chain::chaininterface::ConfirmationTarget::Background
2660- /// [`Normal `]: crate::chain::chaininterface::ConfirmationTarget::Normal
2659+ /// [`ChannelCloseMinimum `]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
2660+ /// [`NonAnchorChannelFee `]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
26612661 /// [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
26622662 pub fn close_channel(&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey) -> Result<(), APIError> {
26632663 self.close_channel_internal(channel_id, counterparty_node_id, None, None)
@@ -2671,8 +2671,8 @@ where
26712671 /// the channel being closed or not:
26722672 /// * If we are the channel initiator, we will pay at least this feerate on the closing
26732673 /// transaction. The upper-bound is set by
2674- /// [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
2675- /// estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
2674+ /// [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
2675+ /// fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
26762676 /// * If our counterparty is the channel initiator, we will refuse to accept a channel closure
26772677 /// transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
26782678 /// will appear on a force-closure transaction, whichever is lower).
@@ -2690,8 +2690,7 @@ where
26902690 /// channel.
26912691 ///
26922692 /// [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
2693- /// [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
2694- /// [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
2693+ /// [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
26952694 /// [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
26962695 pub fn close_channel_with_feerate_and_script(&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, target_feerate_sats_per_1000_weight: Option<u32>, shutdown_script: Option<ShutdownScript>) -> Result<(), APIError> {
26972696 self.close_channel_internal(channel_id, counterparty_node_id, target_feerate_sats_per_1000_weight, shutdown_script)
@@ -4754,8 +4753,8 @@ where
47544753 PersistenceNotifierGuard::optionally_notify(self, || {
47554754 let mut should_persist = NotifyOption::SkipPersistNoEvents;
47564755
4757- let normal_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::Normal );
4758- let min_mempool_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::MempoolMinimum );
4756+ let non_anchor_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::NonAnchorChannelFee );
4757+ let anchor_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::AnchorChannelFee );
47594758
47604759 let per_peer_state = self.per_peer_state.read().unwrap();
47614760 for (_cp_id, peer_state_mutex) in per_peer_state.iter() {
@@ -4765,9 +4764,9 @@ where
47654764 |(chan_id, phase)| if let ChannelPhase::Funded(chan) = phase { Some((chan_id, chan)) } else { None }
47664765 ) {
47674766 let new_feerate = if chan.context.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
4768- min_mempool_feerate
4767+ anchor_feerate
47694768 } else {
4770- normal_feerate
4769+ non_anchor_feerate
47714770 };
47724771 let chan_needs_persist = self.update_channel_fee(chan_id, chan, new_feerate);
47734772 if chan_needs_persist == NotifyOption::DoPersist { should_persist = NotifyOption::DoPersist; }
@@ -4799,8 +4798,8 @@ where
47994798 PersistenceNotifierGuard::optionally_notify(self, || {
48004799 let mut should_persist = NotifyOption::SkipPersistNoEvents;
48014800
4802- let normal_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::Normal );
4803- let min_mempool_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::MempoolMinimum );
4801+ let non_anchor_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::NonAnchorChannelFee );
4802+ let anchor_feerate = self.fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::AnchorChannelFee );
48044803
48054804 let mut handle_errors: Vec<(Result<(), _>, _)> = Vec::new();
48064805 let mut timed_out_mpp_htlcs = Vec::new();
@@ -4847,9 +4846,9 @@ where
48474846 match phase {
48484847 ChannelPhase::Funded(chan) => {
48494848 let new_feerate = if chan.context.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
4850- min_mempool_feerate
4849+ anchor_feerate
48514850 } else {
4852- normal_feerate
4851+ non_anchor_feerate
48534852 };
48544853 let chan_needs_persist = self.update_channel_fee(chan_id, chan, new_feerate);
48554854 if chan_needs_persist == NotifyOption::DoPersist { should_persist = NotifyOption::DoPersist; }
0 commit comments