@@ -2827,10 +2827,16 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2827
2827
feerate_per_kw as u64 * ( commitment_tx_base_weight ( opt_anchors) + num_htlcs as u64 * COMMITMENT_TX_WEIGHT_PER_HTLC ) / 1000
2828
2828
}
2829
2829
2830
- // Get the commitment tx fee for the local's (i.e. our) next commitment transaction based on the
2831
- // number of pending HTLCs that are on track to be in our next commitment tx, plus an additional
2832
- // HTLC if `fee_spike_buffer_htlc` is Some, plus a new HTLC given by `new_htlc_amount`. Dust HTLCs
2833
- // are excluded.
2830
+ /// Get the commitment tx fee for the local's (i.e. our) next commitment transaction based on the
2831
+ /// number of pending HTLCs that are on track to be in our next commitment tx.
2832
+ ///
2833
+ /// Optionally includes the `HTLCCandidate` given by `htlc` and an additional non-dust HTLC if
2834
+ /// `fee_spike_buffer_htlc` is `Some`.
2835
+ ///
2836
+ /// The first extra HTLC is useful for determining whether we can accept a further HTLC, the
2837
+ /// second allows for creating a buffer to ensure a further HTLC can always be accepted/added.
2838
+ ///
2839
+ /// Dust HTLCs are excluded.
2834
2840
fn next_local_commit_tx_fee_msat ( & self , htlc : HTLCCandidate , fee_spike_buffer_htlc : Option < ( ) > ) -> u64 {
2835
2841
assert ! ( self . is_outbound( ) ) ;
2836
2842
@@ -2924,10 +2930,16 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2924
2930
res
2925
2931
}
2926
2932
2927
- // Get the commitment tx fee for the remote's next commitment transaction based on the number of
2928
- // pending HTLCs that are on track to be in their next commitment tx, plus an additional HTLC if
2929
- // `fee_spike_buffer_htlc` is Some, plus a new HTLC given by `new_htlc_amount`. Dust HTLCs are
2930
- // excluded.
2933
+ /// Get the commitment tx fee for the remote's next commitment transaction based on the number of
2934
+ /// pending HTLCs that are on track to be in their next commitment tx
2935
+ ///
2936
+ /// Optionally includes the `HTLCCandidate` given by `htlc` and an additional non-dust HTLC if
2937
+ /// `fee_spike_buffer_htlc` is `Some`.
2938
+ ///
2939
+ /// The first extra HTLC is useful for determining whether we can accept a further HTLC, the
2940
+ /// second allows for creating a buffer to ensure a further HTLC can always be accepted/added.
2941
+ ///
2942
+ /// Dust HTLCs are excluded.
2931
2943
fn next_remote_commit_tx_fee_msat ( & self , htlc : HTLCCandidate , fee_spike_buffer_htlc : Option < ( ) > ) -> u64 {
2932
2944
assert ! ( !self . is_outbound( ) ) ;
2933
2945
0 commit comments