mirror of https://github.com/BTCPrivate/lnd.git
invoices: properly set pointer in invoiceSubscription to fix panic
This commit is contained in:
parent
6ff357686f
commit
862f29c6a2
|
@ -190,7 +190,7 @@ type invoiceSubscription struct {
|
||||||
id uint32
|
id uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel unregisteres the invoiceSubscription, freeing any previoulsy allocate
|
// Cancel unregisters the invoiceSubscription, freeing any previously allocate
|
||||||
// resources.
|
// resources.
|
||||||
func (i *invoiceSubscription) Cancel() {
|
func (i *invoiceSubscription) Cancel() {
|
||||||
i.inv.clientMtx.Lock()
|
i.inv.clientMtx.Lock()
|
||||||
|
@ -205,6 +205,7 @@ func (i *invoiceRegistry) SubscribeNotifications() *invoiceSubscription {
|
||||||
client := &invoiceSubscription{
|
client := &invoiceSubscription{
|
||||||
NewInvoices: make(chan *channeldb.Invoice),
|
NewInvoices: make(chan *channeldb.Invoice),
|
||||||
SettledInvoices: make(chan *channeldb.Invoice),
|
SettledInvoices: make(chan *channeldb.Invoice),
|
||||||
|
inv: i,
|
||||||
}
|
}
|
||||||
|
|
||||||
i.clientMtx.Lock()
|
i.clientMtx.Lock()
|
||||||
|
|
Loading…
Reference in New Issue