Merge pull request #5226 from yyforyongyu/small-fix-invoice

invoices: remove unused param in notifyClients
This commit is contained in:
Olaoluwa Osuntokun 2021-05-19 16:36:06 -07:00 committed by GitHub
commit 47403c0be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -577,7 +577,7 @@ func (i *InvoiceRegistry) AddInvoice(invoice *channeldb.Invoice,
// Now that we've added the invoice, we'll send dispatch a message to // Now that we've added the invoice, we'll send dispatch a message to
// notify the clients of this new invoice. // notify the clients of this new invoice.
i.notifyClients(paymentHash, invoice, channeldb.ContractOpen) i.notifyClients(paymentHash, invoice)
i.Unlock() i.Unlock()
// InvoiceExpiryWatcher.AddInvoice must not be locked by InvoiceRegistry // InvoiceExpiryWatcher.AddInvoice must not be locked by InvoiceRegistry
@ -1138,7 +1138,7 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
// HTLCs, we'll go ahead and notify any clients wiaiting on the invoice // HTLCs, we'll go ahead and notify any clients wiaiting on the invoice
// state changes. // state changes.
if updateSubscribers { if updateSubscribers {
i.notifyClients(ctx.hash, invoice, invoice.State) i.notifyClients(ctx.hash, invoice)
} }
return resolution, nil return resolution, nil
@ -1199,7 +1199,7 @@ func (i *InvoiceRegistry) SettleHodlInvoice(preimage lntypes.Preimage) error {
i.notifyHodlSubscribers(resolution) i.notifyHodlSubscribers(resolution)
} }
i.notifyClients(hash, invoice, invoice.State) i.notifyClients(hash, invoice)
return nil return nil
} }
@ -1292,7 +1292,7 @@ func (i *InvoiceRegistry) cancelInvoiceImpl(payHash lntypes.Hash,
), ),
) )
} }
i.notifyClients(payHash, invoice, channeldb.ContractCanceled) i.notifyClients(payHash, invoice)
// Attempt to also delete the invoice if requested through the registry // Attempt to also delete the invoice if requested through the registry
// config. // config.
@ -1326,8 +1326,7 @@ func (i *InvoiceRegistry) cancelInvoiceImpl(payHash lntypes.Hash,
// notifyClients notifies all currently registered invoice notification clients // notifyClients notifies all currently registered invoice notification clients
// of a newly added/settled invoice. // of a newly added/settled invoice.
func (i *InvoiceRegistry) notifyClients(hash lntypes.Hash, func (i *InvoiceRegistry) notifyClients(hash lntypes.Hash,
invoice *channeldb.Invoice, invoice *channeldb.Invoice) {
state channeldb.ContractState) {
event := &invoiceEvent{ event := &invoiceEvent{
invoice: invoice, invoice: invoice,