@@ -9377,7 +9377,7 @@ impl<
93779377 fn fail_htlc_backwards_internal(
93789378 &self, source: &HTLCSource, payment_hash: &PaymentHash, onion_error: &HTLCFailReason,
93799379 failure_type: HTLCHandlingFailureType,
9380- mut from_monitor_update_completion: Option<PaymentCompleteUpdate >,
9380+ mut from_monitor_update_completion: Option<EventCompletionAction >,
93819381 ) {
93829382 // Ensure that no peer state channel storage lock is held when calling this function.
93839383 // This ensures that future code doesn't introduce a lock-order requirement for
@@ -9431,16 +9431,14 @@ impl<
94319431 &mut from_monitor_update_completion,
94329432 &logger,
94339433 );
9434- if let Some(update ) = from_monitor_update_completion {
9434+ if let Some(action ) = from_monitor_update_completion {
94359435 // If `fail_htlc` didn't `take` the post-event action, we should go ahead and
94369436 // complete it here as the failure was duplicative - we've already handled it.
94379437 // This can happen in rare cases where a MonitorUpdate is replayed after
94389438 // restart because a ChannelMonitor wasn't persisted after it was applied (even
94399439 // though the ChannelManager was).
94409440 // For such cases, we also check that there's no existing pending event to
94419441 // complete this action already, which we let finish instead.
9442- let action =
9443- EventCompletionAction::ReleasePaymentCompleteChannelMonitorUpdate(update);
94449442 let have_action = {
94459443 let pending_events = self.pending_events.lock().unwrap();
94469444 pending_events.iter().any(|(_, act)| act.as_ref() == Some(&action))
@@ -13978,12 +13976,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1397813976 let failure_type = htlc_update
1397913977 .source
1398013978 .failure_type(counterparty_node_id, channel_id);
13981- let completion_update = Some(PaymentCompleteUpdate {
13979+ let completion_update = Some(EventCompletionAction::ReleasePaymentCompleteChannelMonitorUpdate( PaymentCompleteUpdate {
1398213980 counterparty_node_id,
1398313981 channel_funding_outpoint: funding_outpoint,
1398413982 channel_id,
1398513983 htlc_id: SentHTLCId::from_source(&htlc_update.source),
13986- });
13984+ })) ;
1398713985 self.fail_htlc_backwards_internal(
1398813986 &htlc_update.source,
1398913987 &htlc_update.payment_hash,
@@ -20173,12 +20171,16 @@ impl<
2017320171 "Failing HTLC with payment hash {} as it was resolved on-chain.",
2017420172 payment_hash
2017520173 );
20176- let completion_action = Some(PaymentCompleteUpdate {
20177- counterparty_node_id: monitor.get_counterparty_node_id(),
20178- channel_funding_outpoint: monitor.get_funding_txo(),
20179- channel_id: monitor.channel_id(),
20180- htlc_id: SentHTLCId::from_source(&htlc_source),
20181- });
20174+ let completion_action = Some(
20175+ EventCompletionAction::ReleasePaymentCompleteChannelMonitorUpdate(
20176+ PaymentCompleteUpdate {
20177+ counterparty_node_id: monitor.get_counterparty_node_id(),
20178+ channel_funding_outpoint: monitor.get_funding_txo(),
20179+ channel_id: monitor.channel_id(),
20180+ htlc_id: SentHTLCId::from_source(&htlc_source),
20181+ },
20182+ ),
20183+ );
2018220184
2018320185 failed_htlcs.push((
2018420186 htlc_source,
0 commit comments