From 72097059cc438fff9ffc55e58ffb4a40a8b484cd Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 20 Apr 2021 23:47:19 +0800 Subject: [PATCH] invoices: remove unused param in notifyClients --- invoices/invoiceregistry.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/invoices/invoiceregistry.go b/invoices/invoiceregistry.go index b73de5e5..2fa243c0 100644 --- a/invoices/invoiceregistry.go +++ b/invoices/invoiceregistry.go @@ -565,7 +565,7 @@ func (i *InvoiceRegistry) AddInvoice(invoice *channeldb.Invoice, // Now that we've added the invoice, we'll send dispatch a message to // notify the clients of this new invoice. - i.notifyClients(paymentHash, invoice, channeldb.ContractOpen) + i.notifyClients(paymentHash, invoice) i.Unlock() // InvoiceExpiryWatcher.AddInvoice must not be locked by InvoiceRegistry @@ -1103,7 +1103,7 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked( // HTLCs, we'll go ahead and notify any clients wiaiting on the invoice // state changes. if updateSubscribers { - i.notifyClients(ctx.hash, invoice, invoice.State) + i.notifyClients(ctx.hash, invoice) } return resolution, nil @@ -1164,7 +1164,7 @@ func (i *InvoiceRegistry) SettleHodlInvoice(preimage lntypes.Preimage) error { i.notifyHodlSubscribers(resolution) } - i.notifyClients(hash, invoice, invoice.State) + i.notifyClients(hash, invoice) return nil } @@ -1245,7 +1245,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 // config. @@ -1279,8 +1279,7 @@ func (i *InvoiceRegistry) cancelInvoiceImpl(payHash lntypes.Hash, // notifyClients notifies all currently registered invoice notification clients // of a newly added/settled invoice. func (i *InvoiceRegistry) notifyClients(hash lntypes.Hash, - invoice *channeldb.Invoice, - state channeldb.ContractState) { + invoice *channeldb.Invoice) { event := &invoiceEvent{ invoice: invoice,