Skip to content

Commit

Permalink
fix: goroutine leak. cancel grpc sub client
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Feb 10, 2025
1 parent dafe95a commit 3e3d9b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mint/invoicesub.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func (m *Mint) checkInvoicePaid(ctx context.Context, quoteId string) {
return
}

ctx, cancel := context.WithCancel(ctx)
defer cancel()

invoiceSub, err := m.lightningClient.SubscribeInvoice(ctx, mintQuote.PaymentHash)
if err != nil {
m.logErrorf("could not subscribe to invoice changes for mint quote '%v': %v", quoteId, err)
Expand Down

0 comments on commit 3e3d9b8

Please sign in to comment.