From: Matt Corallo Date: Fri, 7 Jul 2023 19:57:23 +0000 (+0000) Subject: Convert `channelmonitor` `vec_type` TLV writes to required/optional X-Git-Tag: v0.0.116-rc1~7^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=4b7631ce161c650932f1dfea3539b3f8c9a1eb37;p=rust-lightning Convert `channelmonitor` `vec_type` TLV writes to required/optional * `HolderSignedTx::htlc_outputs` has always been written since it was converted to TLVs in 86641ea68062388a01c99c6ed131f56477c8e4. * `ChanelMonitorUpdateStep::*::htlc_outputs` have been written since the enum was converted to TLVs in 86641ea68062388a01c99c6. --- diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 904d99413..71fc1cb6f 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -262,7 +262,7 @@ impl_writeable_tlv_based!(HolderSignedTx, { (8, delayed_payment_key, required), (10, per_commitment_point, required), (12, feerate_per_kw, required), - (14, htlc_outputs, vec_type) + (14, htlc_outputs, required_vec) }); impl HolderSignedTx { @@ -538,15 +538,15 @@ impl ChannelMonitorUpdateStep { impl_writeable_tlv_based_enum_upgradable!(ChannelMonitorUpdateStep, (0, LatestHolderCommitmentTXInfo) => { (0, commitment_tx, required), - (1, claimed_htlcs, vec_type), - (2, htlc_outputs, vec_type), + (1, claimed_htlcs, optional_vec), + (2, htlc_outputs, required_vec), (4, nondust_htlc_sources, optional_vec), }, (1, LatestCounterpartyCommitmentTXInfo) => { (0, commitment_txid, required), (2, commitment_number, required), (4, their_per_commitment_point, required), - (6, htlc_outputs, vec_type), + (6, htlc_outputs, required_vec), }, (2, PaymentPreimage) => { (0, payment_preimage, required), @@ -1075,12 +1075,12 @@ impl Writeable for ChannelMonitorImpl ReadableArgs<(&'a ES, &'b SP let mut counterparty_fulfilled_htlcs = Some(HashMap::new()); read_tlv_fields!(reader, { (1, funding_spend_confirmed, option), - (3, htlcs_resolved_on_chain, vec_type), - (5, pending_monitor_events, vec_type), + (3, htlcs_resolved_on_chain, optional_vec), + (5, pending_monitor_events, optional_vec), (7, funding_spend_seen, option), (9, counterparty_node_id, option), (11, confirmed_commitment_tx_counterparty_output, option), - (13, spendable_txids_confirmed, vec_type), + (13, spendable_txids_confirmed, optional_vec), (15, counterparty_fulfilled_htlcs, option), });