]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Explain how rounded millisat values are included in overall balance
authorMatt Corallo <git@bluematt.me>
Fri, 29 Sep 2023 18:31:21 +0000 (18:31 +0000)
committerDuncan Dean <git@dunxen.dev>
Tue, 13 Aug 2024 11:26:57 +0000 (13:26 +0200)
lightning/src/chain/channelmonitor.rs

index ac70434c7101473d2c2bbc88f6e943c8028b19e2..324e08a542ce2434c683cbea1122055f15476cd7 100644 (file)
@@ -635,12 +635,16 @@ pub enum Balance {
                /// [`Balance::MaybeTimeoutClaimableHTLC`] with their
                /// [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag set, as well as any dust
                /// HTLCs which would otherwise be represented the same.
+               ///
+               /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`.
                outbound_payment_htlc_rounded_msat: u64,
                /// The amount of millisatoshis which has been burned to fees from HTLCs which are outbound
                /// from us and are related to a forwarded HTLC. This is the sum of the millisatoshis part
                /// of all HTLCs which are otherwise represented by [`Balance::MaybeTimeoutClaimableHTLC`]
                /// with their [`Balance::MaybeTimeoutClaimableHTLC::outbound_payment`] flag *not* set, as
                /// well as any dust HTLCs which would otherwise be represented the same.
+               ///
+               /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`.
                outbound_forwarded_htlc_rounded_msat: u64,
                /// The amount of millisatoshis which has been burned to fees from HTLCs which are inbound
                /// to us and for which we know the preimage. This is the sum of the millisatoshis part of
@@ -648,12 +652,18 @@ pub enum Balance {
                /// close, but whose current value is included in
                /// [`Balance::ClaimableOnChannelClose::amount_satoshis`], as well as any dust HTLCs which
                /// would otherwise be represented the same.
+               ///
+               /// This amount (rounded up to a whole satoshi value) will not be included in the counterparty's
+               /// `amount_satoshis`.
                inbound_claiming_htlc_rounded_msat: u64,
                /// The amount of millisatoshis which has been burned to fees from HTLCs which are inbound
                /// to us and for which we do not know the preimage. This is the sum of the millisatoshis
                /// part of all HTLCs which would be represented by [`Balance::MaybePreimageClaimableHTLC`]
                /// on channel close, as well as any dust HTLCs which would otherwise be represented the
                /// same.
+               ///
+               /// This amount (rounded up to a whole satoshi value) will not be included in the counterparty's
+               /// `amount_satoshis`.
                inbound_htlc_rounded_msat: u64,
        },
        /// The channel has been closed, and the given balance is ours but awaiting confirmations until
@@ -2403,7 +2413,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
                                        chan_utils::commit_tx_fee_sat(
                                                us.current_holder_commitment_tx.feerate_per_kw, nondust_htlc_count,
                                                us.onchain_tx_handler.channel_type_features())
-                               } else { 0 },
+                                       } else { 0 },
                                outbound_payment_htlc_rounded_msat,
                                outbound_forwarded_htlc_rounded_msat,
                                inbound_claiming_htlc_rounded_msat,