invoices: properly set pointer in invoiceSubscription to fix panic

This commit is contained in:
Olaoluwa Osuntokun 2016-11-21 21:33:29 -06:00
parent 6ff357686f
commit 862f29c6a2
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -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()