@@ -5757,7 +5757,7 @@ where
57575757 },
57585758 }
57595759 } else {
5760- HTLCHandlingType::FailedPayment { payment_hash }
5760+ HTLCHandlingType::ReceiveFailed { payment_hash }
57615761 }
57625762 };
57635763
@@ -5931,7 +5931,7 @@ where
59315931 let reason = if $next_hop_unknown {
59325932 HTLCHandlingType::UnknownNextHop { requested_forward_scid: short_chan_id }
59335933 } else {
5934- HTLCHandlingType::FailedPayment { payment_hash }
5934+ HTLCHandlingType::ReceiveFailed { payment_hash }
59355935 };
59365936
59375937 failed_forwards.push((htlc_source, payment_hash,
@@ -6267,7 +6267,7 @@ where
62676267 cltv_expiry: Some(cltv_expiry),
62686268 }), payment_hash,
62696269 HTLCFailReason::reason(LocalHTLCFailureReason::IncorrectPaymentDetails, err_data),
6270- HTLCHandlingType::FailedPayment { payment_hash: $payment_hash },
6270+ HTLCHandlingType::ReceiveFailed { payment_hash: $payment_hash },
62716271 ));
62726272 continue 'next_forwardable_htlc;
62736273 }
@@ -6825,7 +6825,7 @@ where
68256825 let source = HTLCSource::PreviousHopData(htlc_source.0.clone());
68266826 let failure_reason = LocalHTLCFailureReason::MPPTimeout;
68276827 let reason = HTLCFailReason::from_failure_code(failure_reason);
6828- let receiver = HTLCHandlingType::FailedPayment { payment_hash: htlc_source.1 };
6828+ let receiver = HTLCHandlingType::ReceiveFailed { payment_hash: htlc_source.1 };
68296829 self.fail_htlc_backwards_internal(&source, &htlc_source.1, &reason, receiver);
68306830 }
68316831
@@ -6890,7 +6890,7 @@ where
68906890 for htlc in payment.htlcs {
68916891 let reason = self.get_htlc_fail_reason_from_failure_code(failure_code, &htlc);
68926892 let source = HTLCSource::PreviousHopData(htlc.prev_hop);
6893- let receiver = HTLCHandlingType::FailedPayment { payment_hash: *payment_hash };
6893+ let receiver = HTLCHandlingType::ReceiveFailed { payment_hash: *payment_hash };
68946894 self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
68956895 }
68966896 }
@@ -7118,7 +7118,7 @@ where
71187118 for htlc in htlcs {
71197119 let reason = self.get_htlc_fail_reason_from_failure_code(FailureCode::InvalidOnionPayload(None), &htlc);
71207120 let source = HTLCSource::PreviousHopData(htlc.prev_hop);
7121- let receiver = HTLCHandlingType::FailedPayment { payment_hash };
7121+ let receiver = HTLCHandlingType::ReceiveFailed { payment_hash };
71227122 self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
71237123 }
71247124 return;
@@ -7223,7 +7223,7 @@ where
72237223 let err_data = invalid_payment_err_data(htlc.value, self.best_block.read().unwrap().height);
72247224 let source = HTLCSource::PreviousHopData(htlc.prev_hop);
72257225 let reason = HTLCFailReason::reason(LocalHTLCFailureReason::IncorrectPaymentDetails, err_data);
7226- let receiver = HTLCHandlingType::FailedPayment { payment_hash };
7226+ let receiver = HTLCHandlingType::ReceiveFailed { payment_hash };
72277227 self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
72287228 }
72297229 self.claimable_payments.lock().unwrap().pending_claiming_payments.remove(&payment_hash);
@@ -11814,7 +11814,7 @@ where
1181411814 let reason = LocalHTLCFailureReason::PaymentClaimBuffer;
1181511815 timed_out_htlcs.push((HTLCSource::PreviousHopData(htlc.prev_hop.clone()), payment_hash.clone(),
1181611816 HTLCFailReason::reason(reason, invalid_payment_err_data(htlc.value, height)),
11817- HTLCHandlingType::FailedPayment { payment_hash: payment_hash.clone() }));
11817+ HTLCHandlingType::ReceiveFailed { payment_hash: payment_hash.clone() }));
1181811818 false
1181911819 } else { true }
1182011820 });
@@ -15098,7 +15098,7 @@ mod tests {
1509815098 check_added_monitors!(nodes[1], 0);
1509915099 commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
1510015100 expect_pending_htlcs_forwardable!(nodes[1]);
15101- expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::FailedPayment { payment_hash: our_payment_hash }]);
15101+ expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::ReceiveFailed { payment_hash: our_payment_hash }]);
1510215102 check_added_monitors!(nodes[1], 1);
1510315103 let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1510415104 assert!(updates.update_add_htlcs.is_empty());
@@ -15279,7 +15279,7 @@ mod tests {
1527915279 // We have to forward pending HTLCs twice - once tries to forward the payment forward (and
1528015280 // fails), the second will process the resulting failure and fail the HTLC backward
1528115281 expect_pending_htlcs_forwardable!(nodes[1]);
15282- expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::FailedPayment { payment_hash }]);
15282+ expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::ReceiveFailed { payment_hash }]);
1528315283 check_added_monitors!(nodes[1], 1);
1528415284 let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1528515285 assert!(updates.update_add_htlcs.is_empty());
@@ -15324,7 +15324,7 @@ mod tests {
1532415324 check_added_monitors!(nodes[1], 0);
1532515325 commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
1532615326 expect_pending_htlcs_forwardable!(nodes[1]);
15327- expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::FailedPayment { payment_hash }]);
15327+ expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::ReceiveFailed { payment_hash }]);
1532815328 check_added_monitors!(nodes[1], 1);
1532915329 let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1533015330 assert!(updates.update_add_htlcs.is_empty());
@@ -15371,7 +15371,7 @@ mod tests {
1537115371 check_added_monitors!(nodes[1], 0);
1537215372 commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
1537315373 expect_pending_htlcs_forwardable!(nodes[1]);
15374- expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::FailedPayment { payment_hash }]);
15374+ expect_pending_htlcs_forwardable_and_htlc_handling_failed!(nodes[1], vec![HTLCHandlingType::ReceiveFailed { payment_hash }]);
1537515375 check_added_monitors!(nodes[1], 1);
1537615376 let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1537715377 assert!(updates.update_add_htlcs.is_empty());
@@ -15428,7 +15428,7 @@ mod tests {
1542815428 nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &updates.update_add_htlcs[0]);
1542915429 commitment_signed_dance!(nodes[1], nodes[0], &updates.commitment_signed, false);
1543015430 expect_pending_htlcs_forwardable!(nodes[1]);
15431- expect_htlc_handling_failed_destinations!(nodes[1].node.get_and_clear_pending_events(), &[HTLCHandlingType::FailedPayment { payment_hash: mismatch_payment_hash }]);
15431+ expect_htlc_handling_failed_destinations!(nodes[1].node.get_and_clear_pending_events(), &[HTLCHandlingType::ReceiveFailed { payment_hash: mismatch_payment_hash }]);
1543215432 check_added_monitors(&nodes[1], 1);
1543315433 let _ = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1543415434
0 commit comments