Skip to content

Commit 70ae54f

Browse files
Trivial: user_channel_id in pending_claims_to_replay
Adds support for passing user_channel_id into the pending_claims_to_replay vec, which is used by the ChannelManager on startup. For now user_channel_id is always set to None, but in upcoming commits we will set it to Some when the downstream channel is still open (this is currently a bug). Separated out here for reviewability.
1 parent 3246010 commit 70ae54f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18988,7 +18988,7 @@ impl<
1898818988

1898918989
Some((htlc_source, payment_preimage, htlc.amount_msat,
1899018990
is_channel_closed, monitor.get_counterparty_node_id(),
18991-
monitor.get_funding_txo(), monitor.channel_id()))
18991+
monitor.get_funding_txo(), monitor.channel_id(), None))
1899218992
} else { None }
1899318993
} else {
1899418994
// If it was an outbound payment, we've handled it above - if a preimage
@@ -19354,7 +19354,7 @@ impl<
1935419354
{
1935519355
for (prev_hop, outbound_amt_msat) in forwarded_htlcs {
1935619356
let new_pending_claim =
19357-
!pending_claims_to_replay.iter().any(|(src, _, _, _, _, _, _)| {
19357+
!pending_claims_to_replay.iter().any(|(src, _, _, _, _, _, _, _)| {
1935819358
matches!(src, HTLCSource::PreviousHopData(hop) if hop.htlc_id == prev_hop.htlc_id && hop.channel_id == prev_hop.channel_id)
1935919359
});
1936019360
if new_pending_claim {
@@ -19379,6 +19379,7 @@ impl<
1937919379
counterparty_node_id,
1938019380
monitor.get_funding_txo(),
1938119381
*channel_id,
19382+
None,
1938219383
));
1938319384
}
1938419385
}
@@ -19648,6 +19649,7 @@ impl<
1964819649
downstream_node_id,
1964919650
downstream_funding,
1965019651
downstream_channel_id,
19652+
downstream_user_channel_id,
1965119653
) in pending_claims_to_replay
1965219654
{
1965319655
// We use `downstream_closed` in place of `from_onchain` here just as a guess - we
@@ -19663,7 +19665,7 @@ impl<
1966319665
downstream_node_id,
1966419666
downstream_funding,
1966519667
downstream_channel_id,
19666-
None,
19668+
downstream_user_channel_id,
1966719669
None,
1966819670
None,
1966919671
);

0 commit comments

Comments
 (0)