From 862f29c6a2c5b03622c40b67c1a19839495b44c9 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 21 Nov 2016 21:33:29 -0600 Subject: [PATCH] invoices: properly set pointer in invoiceSubscription to fix panic --- invoiceregistry.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invoiceregistry.go b/invoiceregistry.go index b55bdf6b..d8f18c80 100644 --- a/invoiceregistry.go +++ b/invoiceregistry.go @@ -190,7 +190,7 @@ type invoiceSubscription struct { id uint32 } -// Cancel unregisteres the invoiceSubscription, freeing any previoulsy allocate +// Cancel unregisters the invoiceSubscription, freeing any previously allocate // resources. func (i *invoiceSubscription) Cancel() { i.inv.clientMtx.Lock() @@ -205,6 +205,7 @@ func (i *invoiceRegistry) SubscribeNotifications() *invoiceSubscription { client := &invoiceSubscription{ NewInvoices: make(chan *channeldb.Invoice), SettledInvoices: make(chan *channeldb.Invoice), + inv: i, } i.clientMtx.Lock()