Skip to content

Commit bb36eb1

Browse files
committed
f specify default channel_id for HTLCPreviousHopData & HTLCAddHTLCInfo
1 parent f5ef6e8 commit bb36eb1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9664,7 +9664,9 @@ impl_writeable_tlv_based!(HTLCPreviousHopData, {
96649664
(4, htlc_id, required),
96659665
(6, incoming_packet_shared_secret, required),
96669666
(7, user_channel_id, option),
9667-
(8, channel_id, required),
9667+
// Note that by the time we get past the required read for type 2 above, outpoint will be
9668+
// filled in, so we can safely unwrap it here.
9669+
(9, channel_id, (default_value, ChannelId::v1_from_funding_outpoint(outpoint.0.unwrap()))),
96689670
});
96699671

96709672
impl Writeable for ClaimableHTLC {
@@ -9816,7 +9818,9 @@ impl_writeable_tlv_based!(PendingAddHTLCInfo, {
98169818
(2, prev_short_channel_id, required),
98179819
(4, prev_htlc_id, required),
98189820
(6, prev_funding_outpoint, required),
9819-
(8, prev_channel_id, required),
9821+
// Note that by the time we get past the required read for type 2 above, prev_funding_outpoint will be
9822+
// filled in, so we can safely unwrap it here.
9823+
(7, prev_channel_id, (default_value, ChannelId::v1_from_funding_outpoint(prev_funding_outpoint.0.unwrap()))),
98209824
});
98219825

98229826
impl Writeable for HTLCForwardInfo {

0 commit comments

Comments
 (0)