From 4c9fbe8e791bfee055ecf1f94f83d6f7c83a3618 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Fri, 23 Jun 2023 22:35:14 -0700 Subject: [PATCH] Fix warning about deserialization marker. Specifically, the legacy deserialization prevention marker variable was not being read. --- lightning/src/chain/package.rs | 16 ++++++++-------- lightning/src/ln/chan_utils.rs | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lightning/src/chain/package.rs b/lightning/src/chain/package.rs index 4576fde02..9e61cbc45 100644 --- a/lightning/src/chain/package.rs +++ b/lightning/src/chain/package.rs @@ -247,7 +247,7 @@ impl Readable for CounterpartyOfferedHTLCOutput { let mut counterparty_htlc_base_key = RequiredWrapper(None); let mut preimage = RequiredWrapper(None); let mut htlc = RequiredWrapper(None); - let mut legacy_deserialization_prevention_marker: Option<()> = None; + let mut _legacy_deserialization_prevention_marker: Option<()> = None; let mut channel_type_features = None; read_tlv_fields!(reader, { @@ -256,7 +256,7 @@ impl Readable for CounterpartyOfferedHTLCOutput { (4, counterparty_htlc_base_key, required), (6, preimage, required), (8, htlc, required), - (10, legacy_deserialization_prevention_marker, option), + (10, _legacy_deserialization_prevention_marker, option), (11, channel_type_features, option), }); @@ -321,7 +321,7 @@ impl Readable for CounterpartyReceivedHTLCOutput { let mut counterparty_delayed_payment_base_key = RequiredWrapper(None); let mut counterparty_htlc_base_key = RequiredWrapper(None); let mut htlc = RequiredWrapper(None); - let mut legacy_deserialization_prevention_marker: Option<()> = None; + let mut _legacy_deserialization_prevention_marker: Option<()> = None; let mut channel_type_features = None; read_tlv_fields!(reader, { @@ -329,7 +329,7 @@ impl Readable for CounterpartyReceivedHTLCOutput { (2, counterparty_delayed_payment_base_key, required), (4, counterparty_htlc_base_key, required), (6, htlc, required), - (8, legacy_deserialization_prevention_marker, option), + (8, _legacy_deserialization_prevention_marker, option), (9, channel_type_features, option), }); @@ -399,14 +399,14 @@ impl Readable for HolderHTLCOutput { let mut amount_msat = RequiredWrapper(None); let mut cltv_expiry = RequiredWrapper(None); let mut preimage = None; - let mut legacy_deserialization_prevention_marker: Option<()> = None; + let mut _legacy_deserialization_prevention_marker: Option<()> = None; let mut channel_type_features = None; read_tlv_fields!(reader, { (0, amount_msat, required), (2, cltv_expiry, required), (4, preimage, option), - (6, legacy_deserialization_prevention_marker, option), + (6, _legacy_deserialization_prevention_marker, option), (7, channel_type_features, option), }); @@ -460,14 +460,14 @@ impl Writeable for HolderFundingOutput { impl Readable for HolderFundingOutput { fn read(reader: &mut R) -> Result { let mut funding_redeemscript = RequiredWrapper(None); - let mut legacy_deserialization_prevention_marker: Option<()> = None; + let mut _legacy_deserialization_prevention_marker: Option<()> = None; let mut channel_type_features = None; let mut funding_amount = None; read_tlv_fields!(reader, { (0, funding_redeemscript, required), (1, channel_type_features, option), - (2, legacy_deserialization_prevention_marker, option), + (2, _legacy_deserialization_prevention_marker, option), (3, funding_amount, option) }); diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs index 0f5a45346..fd27d2308 100644 --- a/lightning/src/ln/chan_utils.rs +++ b/lightning/src/ln/chan_utils.rs @@ -938,7 +938,7 @@ impl Readable for ChannelTransactionParameters { let mut is_outbound_from_holder = RequiredWrapper(None); let mut counterparty_parameters = None; let mut funding_outpoint = None; - let mut legacy_deserialization_prevention_marker: Option<()> = None; + let mut _legacy_deserialization_prevention_marker: Option<()> = None; let mut channel_type_features = None; read_tlv_fields!(reader, { @@ -947,7 +947,7 @@ impl Readable for ChannelTransactionParameters { (4, is_outbound_from_holder, required), (6, counterparty_parameters, option), (8, funding_outpoint, option), - (10, legacy_deserialization_prevention_marker, option), + (10, _legacy_deserialization_prevention_marker, option), (11, channel_type_features, option), }); @@ -1363,7 +1363,7 @@ impl Readable for CommitmentTransaction { let mut keys = RequiredWrapper(None); let mut built = RequiredWrapper(None); _init_tlv_field_var!(htlcs, vec_type); - let mut legacy_deserialization_prevention_marker: Option<()> = None; + let mut _legacy_deserialization_prevention_marker: Option<()> = None; let mut channel_type_features = None; read_tlv_fields!(reader, { @@ -1374,7 +1374,7 @@ impl Readable for CommitmentTransaction { (8, keys, required), (10, built, required), (12, htlcs, vec_type), - (14, legacy_deserialization_prevention_marker, option), + (14, _legacy_deserialization_prevention_marker, option), (15, channel_type_features, option), }); -- 2.39.5