]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Use even types for opt_anchors
authorWilmer Paulino <wilmer.paulino@gmail.com>
Wed, 7 Dec 2022 18:30:25 +0000 (10:30 -0800)
committerWilmer Paulino <wilmer.paulino@gmail.com>
Wed, 7 Dec 2022 18:35:54 +0000 (10:35 -0800)
This prevents downgrading to older versions of LDK that are not capable
of supporting anchor channels when the field is serialized (i.e.,
opt_anchors is `Some`).

lightning/src/chain/package.rs

index dbf46298888ce20a8225c6a11bd88e1394c2552e..227e5ccd119188204b6f374300b0e5dceb777f46 100644 (file)
@@ -203,11 +203,11 @@ impl CounterpartyOfferedHTLCOutput {
 
 impl_writeable_tlv_based!(CounterpartyOfferedHTLCOutput, {
        (0, per_commitment_point, required),
-       (1, opt_anchors, option),
        (2, counterparty_delayed_payment_base_key, required),
        (4, counterparty_htlc_base_key, required),
        (6, preimage, required),
        (8, htlc, required),
+       (10, opt_anchors, option),
 });
 
 /// A struct to describe a HTLC output on a counterparty commitment transaction.
@@ -241,10 +241,10 @@ impl CounterpartyReceivedHTLCOutput {
 
 impl_writeable_tlv_based!(CounterpartyReceivedHTLCOutput, {
        (0, per_commitment_point, required),
-       (1, opt_anchors, option),
        (2, counterparty_delayed_payment_base_key, required),
        (4, counterparty_htlc_base_key, required),
        (6, htlc, required),
+       (8, opt_anchors, option),
 });
 
 /// A struct to describe a HTLC output on holder commitment transaction.
@@ -318,7 +318,7 @@ impl HolderFundingOutput {
 
 impl_writeable_tlv_based!(HolderFundingOutput, {
        (0, funding_redeemscript, required),
-       (1, opt_anchors, option),
+       (2, opt_anchors, option),
        (3, funding_amount, option),
 });