@@ -5757,7 +5757,7 @@ where
5757
5757
},
5758
5758
}
5759
5759
} else {
5760
- HTLCHandlingType::FailedPayment { payment_hash }
5760
+ HTLCHandlingType::ReceiveFailed { payment_hash }
5761
5761
}
5762
5762
};
5763
5763
@@ -5931,7 +5931,7 @@ where
5931
5931
let reason = if $next_hop_unknown {
5932
5932
HTLCHandlingType::UnknownNextHop { requested_forward_scid: short_chan_id }
5933
5933
} else {
5934
- HTLCHandlingType::FailedPayment { payment_hash }
5934
+ HTLCHandlingType::ReceiveFailed { payment_hash }
5935
5935
};
5936
5936
5937
5937
failed_forwards.push((htlc_source, payment_hash,
@@ -6267,7 +6267,7 @@ where
6267
6267
cltv_expiry: Some(cltv_expiry),
6268
6268
}), payment_hash,
6269
6269
HTLCFailReason::reason(LocalHTLCFailureReason::IncorrectPaymentDetails, err_data),
6270
- HTLCHandlingType::FailedPayment { payment_hash: $payment_hash },
6270
+ HTLCHandlingType::ReceiveFailed { payment_hash: $payment_hash },
6271
6271
));
6272
6272
continue 'next_forwardable_htlc;
6273
6273
}
@@ -6825,7 +6825,7 @@ where
6825
6825
let source = HTLCSource::PreviousHopData(htlc_source.0.clone());
6826
6826
let failure_reason = LocalHTLCFailureReason::MPPTimeout;
6827
6827
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 };
6829
6829
self.fail_htlc_backwards_internal(&source, &htlc_source.1, &reason, receiver);
6830
6830
}
6831
6831
@@ -6890,7 +6890,7 @@ where
6890
6890
for htlc in payment.htlcs {
6891
6891
let reason = self.get_htlc_fail_reason_from_failure_code(failure_code, &htlc);
6892
6892
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 };
6894
6894
self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
6895
6895
}
6896
6896
}
@@ -7118,7 +7118,7 @@ where
7118
7118
for htlc in htlcs {
7119
7119
let reason = self.get_htlc_fail_reason_from_failure_code(FailureCode::InvalidOnionPayload(None), &htlc);
7120
7120
let source = HTLCSource::PreviousHopData(htlc.prev_hop);
7121
- let receiver = HTLCHandlingType::FailedPayment { payment_hash };
7121
+ let receiver = HTLCHandlingType::ReceiveFailed { payment_hash };
7122
7122
self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
7123
7123
}
7124
7124
return;
@@ -7223,7 +7223,7 @@ where
7223
7223
let err_data = invalid_payment_err_data(htlc.value, self.best_block.read().unwrap().height);
7224
7224
let source = HTLCSource::PreviousHopData(htlc.prev_hop);
7225
7225
let reason = HTLCFailReason::reason(LocalHTLCFailureReason::IncorrectPaymentDetails, err_data);
7226
- let receiver = HTLCHandlingType::FailedPayment { payment_hash };
7226
+ let receiver = HTLCHandlingType::ReceiveFailed { payment_hash };
7227
7227
self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
7228
7228
}
7229
7229
self.claimable_payments.lock().unwrap().pending_claiming_payments.remove(&payment_hash);
@@ -11814,7 +11814,7 @@ where
11814
11814
let reason = LocalHTLCFailureReason::PaymentClaimBuffer;
11815
11815
timed_out_htlcs.push((HTLCSource::PreviousHopData(htlc.prev_hop.clone()), payment_hash.clone(),
11816
11816
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() }));
11818
11818
false
11819
11819
} else { true }
11820
11820
});
@@ -15098,7 +15098,7 @@ mod tests {
15098
15098
check_added_monitors!(nodes[1], 0);
15099
15099
commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
15100
15100
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 }]);
15102
15102
check_added_monitors!(nodes[1], 1);
15103
15103
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
15104
15104
assert!(updates.update_add_htlcs.is_empty());
@@ -15279,7 +15279,7 @@ mod tests {
15279
15279
// We have to forward pending HTLCs twice - once tries to forward the payment forward (and
15280
15280
// fails), the second will process the resulting failure and fail the HTLC backward
15281
15281
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 }]);
15283
15283
check_added_monitors!(nodes[1], 1);
15284
15284
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
15285
15285
assert!(updates.update_add_htlcs.is_empty());
@@ -15324,7 +15324,7 @@ mod tests {
15324
15324
check_added_monitors!(nodes[1], 0);
15325
15325
commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
15326
15326
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 }]);
15328
15328
check_added_monitors!(nodes[1], 1);
15329
15329
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
15330
15330
assert!(updates.update_add_htlcs.is_empty());
@@ -15371,7 +15371,7 @@ mod tests {
15371
15371
check_added_monitors!(nodes[1], 0);
15372
15372
commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
15373
15373
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 }]);
15375
15375
check_added_monitors!(nodes[1], 1);
15376
15376
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
15377
15377
assert!(updates.update_add_htlcs.is_empty());
@@ -15428,7 +15428,7 @@ mod tests {
15428
15428
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &updates.update_add_htlcs[0]);
15429
15429
commitment_signed_dance!(nodes[1], nodes[0], &updates.commitment_signed, false);
15430
15430
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 }]);
15432
15432
check_added_monitors(&nodes[1], 1);
15433
15433
let _ = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
15434
15434
0 commit comments