invoices: adding InvoiceExpryWatcher to cancel expired invoices
This commit adds InvoiceExpryWatcher which is a separate class that receives new invoices (and existing ones upon restart) from InvoiceRegistry and actively watches their expiry. When an invoice is expired InvoiceExpiryWatcher will call into InvoiceRegistry to cancel the invoice and by that notify all subscribers about the state change.
This commit is contained in:
1 parent
7024f36a76
commit
44f13d1d60
9 files changed
+643
-13
No files matched your search
@@ -82,6 +82,10 @@ const (
|
||||
// This is chosen to be the maximum number of bytes that can fit into a
|
||||
// single QR code: https://en.wikipedia.org/wiki/QR_code#Storage
|
||||
maxInvoiceLength = 7089
|
||||
|
||||
// DefaultInvoiceExpiry is the default expiry duration from the creation
|
||||
// timestamp if expiry is set to zero.
|
||||
DefaultInvoiceExpiry = time.Hour
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in new issue
Block a user