You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if remote_balance_before_fee_msat < msg.amount_msat {
5772
5779
return Err(ChannelError::close("Remote HTLC add would overdraw remaining funds".to_owned()));
5773
5780
}
5774
5781
@@ -5779,29 +5786,19 @@ impl<SP: Deref> FundedChannel<SP> where
5779
5786
let htlc_candidate = HTLCCandidate::new(msg.amount_msat, HTLCInitiator::RemoteOffered);
5780
5787
self.context.next_remote_commit_tx_fee_msat(&self.funding, Some(htlc_candidate), None) // Don't include the extra fee spike buffer HTLC in calculations
5781
5788
};
5782
-
let anchor_outputs_value_msat = if !self.funding.is_outbound() && self.funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
5783
-
ANCHOR_OUTPUT_VALUE_SATOSHI * 2 * 1000
5784
-
} else {
5785
-
0
5786
-
};
5787
-
if pending_remote_value_msat.saturating_sub(msg.amount_msat).saturating_sub(anchor_outputs_value_msat) < remote_commit_tx_fee_msat {
5789
+
if remote_balance_before_fee_msat.saturating_sub(msg.amount_msat) < remote_commit_tx_fee_msat {
5788
5790
return Err(ChannelError::close("Remote HTLC add would not leave enough to pay for fees".to_owned()));
5789
5791
};
5790
-
if pending_remote_value_msat.saturating_sub(msg.amount_msat).saturating_sub(remote_commit_tx_fee_msat).saturating_sub(anchor_outputs_value_msat) < self.funding.holder_selected_channel_reserve_satoshis * 1000 {
5792
+
if remote_balance_before_fee_msat.saturating_sub(msg.amount_msat).saturating_sub(remote_commit_tx_fee_msat) < self.funding.holder_selected_channel_reserve_satoshis * 1000 {
5791
5793
return Err(ChannelError::close("Remote HTLC add would put them under remote reserve value".to_owned()));
5792
5794
}
5793
5795
}
5794
5796
5795
-
let anchor_outputs_value_msat = if self.funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
5796
-
ANCHOR_OUTPUT_VALUE_SATOSHI * 2 * 1000
5797
-
} else {
5798
-
0
5799
-
};
5800
5797
if self.funding.is_outbound() {
5801
5798
// Check that they won't violate our local required channel reserve by adding this HTLC.
5802
5799
let htlc_candidate = HTLCCandidate::new(msg.amount_msat, HTLCInitiator::RemoteOffered);
5803
5800
let local_commit_tx_fee_msat = self.context.next_local_commit_tx_fee_msat(&self.funding, htlc_candidate, None);
0 commit comments