Merge pull request #5206 from carlaKC/4987-heightexpirywatcher

invoices: add height based expiry watcher
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2021-05-12 13:41:52 -07:00
commit 86c5e483b2
13 files changed
+819 -87

No files matched your search

+10
View File
@@ -1118,6 +1118,16 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
}
// If we have fully accepted the set of htlcs for this invoice,
// we can now add it to our invoice expiry watcher. We do not
// add invoices before they are fully accepted, because it is
// possible that we MppTimeout the htlcs, and then our relevant
// expiry height could change.
if res.outcome == resultAccepted {
expiry := makeInvoiceExpiry(ctx.hash, invoice)
i.expiryWatcher.AddInvoices(expiry)
}
i.hodlSubscribe(hodlChan, ctx.circuitKey)
default: