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

+4 -2
View File
@@ -290,12 +290,14 @@ func (p *KVStore) InitPayment(_ context.Context, paymentHash lntypes.Hash,
// DeleteFailedAttempts deletes all failed htlcs for a payment if configured
// by the KVStore db.
func (p *KVStore) DeleteFailedAttempts(hash lntypes.Hash) error {
func (p *KVStore) DeleteFailedAttempts(ctx context.Context,
hash lntypes.Hash) error {
// TODO(ziggie): Refactor to not mix application logic with database
// logic. This decision should be made in the application layer.
if !p.keepFailedPaymentAttempts {
const failedHtlcsOnly = true
err := p.DeletePayment(context.TODO(), hash, failedHtlcsOnly)
err := p.DeletePayment(ctx, hash, failedHtlcsOnly)
if err != nil {
return err
}