Skip to content

Commit cb9ae00

Browse files
Pass peer_node_id to fail_holding_cell_htlcs
1 parent 8e5cf75 commit cb9ae00

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,7 +3620,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
36203620
// Fail a list of HTLCs that were just freed from the holding cell. The HTLCs need to be
36213621
// failed backwards or, if they were one of our outgoing HTLCs, then their failure needs to
36223622
// be surfaced to the user.
3623-
fn fail_holding_cell_htlcs(&self, mut htlcs_to_fail: Vec<(HTLCSource, PaymentHash)>, channel_id: [u8; 32]) {
3623+
fn fail_holding_cell_htlcs(&self, mut htlcs_to_fail: Vec<(HTLCSource, PaymentHash)>, channel_id: [u8; 32], _counterparty_node_id: &PublicKey) {
36243624
for (htlc_src, payment_hash) in htlcs_to_fail.drain(..) {
36253625
match htlc_src {
36263626
HTLCSource::PreviousHopData(HTLCPreviousHopData { .. }) => {
@@ -4828,7 +4828,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
48284828
hash_map::Entry::Vacant(_) => break Err(MsgHandleErrInternal::send_err_msg_no_close("Failed to find corresponding channel".to_owned(), msg.channel_id))
48294829
}
48304830
};
4831-
self.fail_holding_cell_htlcs(htlcs_to_fail, msg.channel_id);
4831+
self.fail_holding_cell_htlcs(htlcs_to_fail, msg.channel_id, counterparty_node_id);
48324832
match res {
48334833
Ok((pending_forwards, mut pending_failures, finalized_claim_htlcs,
48344834
short_channel_id, channel_outpoint)) =>
@@ -4968,7 +4968,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
49684968
}
49694969
};
49704970
post_handle_chan_restoration!(self, chan_restoration_res);
4971-
self.fail_holding_cell_htlcs(htlcs_failed_forward, msg.channel_id);
4971+
self.fail_holding_cell_htlcs(htlcs_failed_forward, msg.channel_id, counterparty_node_id);
49724972

49734973
if let Some(channel_ready_msg) = need_lnd_workaround {
49744974
self.internal_channel_ready(counterparty_node_id, &channel_ready_msg)?;
@@ -5066,7 +5066,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
50665066
match chan.maybe_free_holding_cell_htlcs(&self.logger) {
50675067
Ok((commitment_opt, holding_cell_failed_htlcs)) => {
50685068
if !holding_cell_failed_htlcs.is_empty() {
5069-
failed_htlcs.push((holding_cell_failed_htlcs, *channel_id));
5069+
failed_htlcs.push((holding_cell_failed_htlcs, *channel_id, chan.get_counterparty_node_id()));
50705070
}
50715071
if let Some((commitment_update, monitor_update)) = commitment_opt {
50725072
if let Err(e) = self.chain_monitor.update_channel(chan.get_funding_txo().unwrap(), monitor_update) {
@@ -5094,8 +5094,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
50945094
}
50955095

50965096
let has_update = has_monitor_update || !failed_htlcs.is_empty() || !handle_errors.is_empty();
5097-
for (failures, channel_id) in failed_htlcs.drain(..) {
5098-
self.fail_holding_cell_htlcs(failures, channel_id);
5097+
for (failures, channel_id, counterparty_node_id) in failed_htlcs.drain(..) {
5098+
self.fail_holding_cell_htlcs(failures, channel_id, &counterparty_node_id);
50995099
}
51005100

51015101
for (counterparty_node_id, err) in handle_errors.drain(..) {

0 commit comments

Comments
 (0)