Skip to content

Avoid previously failed hops on PaymentFailure::AllFailedResendSafe #1969

Closed
@tnull

Description

@tnull

Currently, only PaymentFailure::PartialFailure carry PaymentParameters, which is why InvoicePayer retries any PaymentFailure::AllFailedResendSafes with empty previously_failed_channels:

PaymentSendFailure::AllFailedResendSafe(_) => {
let mut payment_cache = self.payment_cache.lock().unwrap();
let payment_attempts = payment_cache.get_mut(&payment_hash).unwrap();
payment_attempts.count += 1;
if self.retry.is_retryable_now(payment_attempts) {
core::mem::drop(payment_cache);
Ok(self.pay_internal(params, payment_hash, send_payment)?)
} else {
Err(e)
}

As this may result in a loop where a failing route is retried over and over again until we run out of time or attempts, we probably want to consider any previously failed channels in the AllFailedResendSafe case also.

As InvoicePayer is pending deprecation anyways, this probably should be fixed as part of the migration of the retry logic to ChannelManager.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions