multi: thread context through DeleteFailedAttempts

This commit is contained in:
ziggie committed 2026-02-25 08:02:24 +01:00
1 parent 635a67c94a
commit 7f2df4b088
7 files changed
+44 -18

No files matched your search

+7 -1
View File
@@ -190,6 +190,10 @@ func (p *paymentLifecycle) decideNextStep(
func (p *paymentLifecycle) resumePayment(ctx context.Context) ([32]byte,
*route.Route, error) {
// We need to make sure we can still do db operations after the context
// is cancelled.
cleanupCtx := context.WithoutCancel(ctx)
// When the payment lifecycle loop exits, we make sure to signal any
// sub goroutine of the HTLC attempt to exit, then wait for them to
// return.
@@ -328,7 +332,9 @@ lifecycle:
// Optionally delete the failed attempts from the database. Depends on
// the database options deleting attempts is not allowed so this will
// just be a no-op.
err = p.router.cfg.Control.DeleteFailedAttempts(p.identifier)
err = p.router.cfg.Control.DeleteFailedAttempts(
cleanupCtx, p.identifier,
)
if err != nil {
log.Errorf("Error deleting failed htlc attempts for payment "+
"%v: %v", p.identifier, err)