mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 01:18:17 +02:00
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:
@@ -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