invoices: return error from SubscribeNotifications on shutdown

This commit is contained in:
Conner Fromknecht committed 2020-05-26 17:50:45 -07:00
1 parent 1332575482
commit 5b747715fc
3 files changed
+19 -8

No files matched your search

+4 -1
View File
@@ -4535,9 +4535,12 @@ func (r *rpcServer) ListInvoices(ctx context.Context,
func (r *rpcServer) SubscribeInvoices(req *lnrpc.InvoiceSubscription,
updateStream lnrpc.Lightning_SubscribeInvoicesServer) error {
invoiceClient := r.server.invoices.SubscribeNotifications(
invoiceClient, err := r.server.invoices.SubscribeNotifications(
req.AddIndex, req.SettleIndex,
)
if err != nil {
return err
}
defer invoiceClient.Cancel()
for {