htlcswitch: abtract invoice from link

This commit detaches signaling the invoice registry that an htlc was
locked in from the actually settling of the htlc.

It is a preparation for hodl invoices.
This commit is contained in:
Joost Jager committed 2019-03-15 10:09:15 +01:00
1 parent aeb35d9898
commit 1f41a2abce
6 files changed
+162 -98

No files matched your search

+5 -5
View File
@@ -759,18 +759,18 @@ func (i *mockInvoiceRegistry) LookupInvoice(rHash lntypes.Hash) (channeldb.Invoi
return i.registry.LookupInvoice(rHash)
}
func (i *mockInvoiceRegistry) SettleInvoice(rhash lntypes.Hash,
amt lnwire.MilliSatoshi) error {
func (i *mockInvoiceRegistry) NotifyExitHopHtlc(rhash lntypes.Hash,
amt lnwire.MilliSatoshi) (*invoices.HodlEvent, error) {
err := i.registry.SettleInvoice(rhash, amt)
event, err := i.registry.NotifyExitHopHtlc(rhash, amt)
if err != nil {
return err
return event, err
}
if i.settleChan != nil {
i.settleChan <- rhash
}
return nil
return event, err
}
func (i *mockInvoiceRegistry) CancelInvoice(payHash lntypes.Hash) error {