Use context background on all needed places

This commit is contained in:
Stefan Kostic
2022-02-17 15:17:05 +01:00
parent fea16623ab
commit 2e5f411cf1

View File

@@ -174,7 +174,7 @@ func (svc *LndhubService) PayInvoice(ctx context.Context, invoice *models.Invoic
if svc.IdentityPubkey == invoice.DestinationPubkeyHex {
paymentResponse, err = svc.SendInternalPayment(context.Background(), invoice)
if err != nil {
svc.HandleFailedPayment(ctx, invoice, entry, err)
svc.HandleFailedPayment(context.Background(), invoice, entry, err)
return nil, err
}
} else {
@@ -189,7 +189,7 @@ func (svc *LndhubService) PayInvoice(ctx context.Context, invoice *models.Invoic
// The payment was successful.
invoice.Preimage = paymentResponse.PaymentPreimageStr
err = svc.HandleSuccessfulPayment(ctx, invoice)
err = svc.HandleSuccessfulPayment(context.Background(), invoice)
return &paymentResponse, err
}