invoiceregistry: make the invoice ntfn chan buffered

In this commit, we update the main invoiceEvents channel within the
invoiceregistry to now have an initial buffer size of 100. We do this as
it's been reported by users that on start up they're unable to actually
create or settle invoices manually. Traces have shown that this is due
to contention while holding the invoice mutex. To attempt to solve this,
we add an additional buffer to the channel as most sends will now be
routinely non blocking.
This commit is contained in:
Olaoluwa Osuntokun 2018-07-17 16:53:28 -07:00
parent daf4a25fd9
commit c965e0f4a9
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -64,7 +64,7 @@ func newInvoiceRegistry(cdb *channeldb.DB) *invoiceRegistry {
notificationClients: make(map[uint32]*invoiceSubscription),
newSubscriptions: make(chan *invoiceSubscription),
subscriptionCancels: make(chan uint32),
invoiceEvents: make(chan *invoiceEvent),
invoiceEvents: make(chan *invoiceEvent, 100),
quit: make(chan struct{}),
}
}