]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Specify amount units in HolderHTLCOutput
authorWilmer Paulino <wilmer.paulino@gmail.com>
Wed, 13 Jul 2022 17:27:45 +0000 (10:27 -0700)
committerWilmer Paulino <wilmer.paulino@gmail.com>
Wed, 7 Dec 2022 00:48:07 +0000 (16:48 -0800)
This is only a name change, there is no change in behavior.

lightning/src/chain/package.rs

index 32f38323d81a7f6a4c1648d31b2025262a04501f..35d90fb31812434afacffb33e4cb8ca798da319e 100644 (file)
@@ -252,31 +252,31 @@ impl_writeable_tlv_based!(CounterpartyReceivedHTLCOutput, {
 #[derive(Clone, PartialEq, Eq)]
 pub(crate) struct HolderHTLCOutput {
        preimage: Option<PaymentPreimage>,
-       amount: u64,
+       amount_msat: u64,
        /// Defaults to 0 for HTLC-Success transactions, which have no expiry
        cltv_expiry: u32,
 }
 
 impl HolderHTLCOutput {
-       pub(crate) fn build_offered(amount: u64, cltv_expiry: u32) -> Self {
+       pub(crate) fn build_offered(amount_msat: u64, cltv_expiry: u32) -> Self {
                HolderHTLCOutput {
                        preimage: None,
-                       amount,
+                       amount_msat,
                        cltv_expiry,
                }
        }
 
-       pub(crate) fn build_accepted(preimage: PaymentPreimage, amount: u64) -> Self {
+       pub(crate) fn build_accepted(preimage: PaymentPreimage, amount_msat: u64) -> Self {
                HolderHTLCOutput {
                        preimage: Some(preimage),
-                       amount,
+                       amount_msat,
                        cltv_expiry: 0,
                }
        }
 }
 
 impl_writeable_tlv_based!(HolderHTLCOutput, {
-       (0, amount, required),
+       (0, amount_msat, required),
        (2, cltv_expiry, required),
        (4, preimage, option)
 });