-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not retry sending if payment gets confirmed on chain #1799
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
private def isFinalRecipientFailure(pf: PaymentFailed, d: PaymentProgress): Boolean = pf.failures.collectFirst { | ||
/** When we receive an error from the final recipient or payment gets confirmed on chain, we should fail the whole payment, it's useless to retry. */ | ||
private def doNotRetry(pf: PaymentFailed, d: PaymentProgress): Boolean = pf.failures.collectFirst { | ||
case LocalFailure(_, _: HtlcsTimedoutDownstream | _: HtlcOverriddenByLocalCommit) => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is HtlcsWillTimeoutUpstream
as well.
You should probably create a dedicated method isOnChainFail(f: PaymentFailure)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems I'd have to do exactly the same matching in a new method, what about keeping as is but expanding each case: 776d9df#diff-f28a1f15ee9515a9b2bb404c65cb4a01415b12d264f509420bdfb1251fd49afbR382-R388 ?
eclair-core/src/main/scala/fr/acinq/eclair/payment/send/MultiPartPaymentLifecycle.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/send/MultiPartPaymentLifecycle.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/payment/MultiPartPaymentLifecycleSpec.scala
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #1799 +/- ##
==========================================
- Coverage 89.34% 89.33% -0.01%
==========================================
Files 144 143 -1
Lines 10934 10934
Branches 458 464 +6
==========================================
- Hits 9769 9768 -1
- Misses 1165 1166 +1
|
This fixes a case where
MultiPartPaymentLifecycle
keeps retrying a payment even after it got confirmed on chain. Doing so is harmless but meaningless.