Skip to content

Commit 22a7f78

Browse files
fixup: simplify tlv fields with (default_value,x)
1 parent 5622a33 commit 22a7f78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6540,8 +6540,10 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
65406540
(32, pending_funding, optional_vec),
65416541
(33, htlcs_resolved_to_user, option),
65426542
(34, alternative_funding_confirmed, option),
6543-
(35, is_manual_broadcast, option),
6544-
(37, funding_seen_onchain, option),
6543+
(35, is_manual_broadcast, (default_value, false)),
6544+
// Older monitors prior to LDK 0.2 assume this is `true` when absent
6545+
// during upgrade so holder broadcasts aren't gated unexpectedly.
6546+
(37, funding_seen_onchain, (default_value, true)),
65456547
});
65466548
// Note that `payment_preimages_with_info` was added (and is always written) in LDK 0.1, so
65476549
// we can use it to determine if this monitor was last written by LDK 0.1 or later.
@@ -6659,10 +6661,8 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
66596661
prev_holder_commitment_tx,
66606662
},
66616663
pending_funding: pending_funding.unwrap_or(vec![]),
6662-
is_manual_broadcast: is_manual_broadcast.unwrap_or(false),
6663-
// Older monitors prior to LDK 0.2 assume this is `true` when absent
6664-
// during upgrade so holder broadcasts aren't gated unexpectedly.
6665-
funding_seen_onchain: funding_seen_onchain.unwrap_or(true),
6664+
is_manual_broadcast: is_manual_broadcast.unwrap(),
6665+
funding_seen_onchain: funding_seen_onchain.unwrap(),
66666666

66676667
latest_update_id,
66686668
commitment_transaction_number_obscure_factor,

0 commit comments

Comments
 (0)