lnd: extend the invoiceRegistry to wrap on-disk invoices with an in-memory cache
This commit extends the existing invoiceRegistry functionality to wrap the on-disk invoices available via the channeldb with an in-memory cache on invoices. Currently the in-memory cache is only reserved for the storage of special “debug” invoices which all nodes are able to settle immediately.
This commit is contained in:
3 files changed
+91
-52
No files matched your search
@@ -92,7 +92,7 @@ func newServer(listenAddrs []string, notifier chainntnfs.ChainNotifier,
|
||||
chanDB: chanDB,
|
||||
fundingMgr: newFundingManager(wallet),
|
||||
htlcSwitch: newHtlcSwitch(),
|
||||
invoices: newInvoiceRegistry(),
|
||||
invoices: newInvoiceRegistry(chanDB),
|
||||
lnwallet: wallet,
|
||||
identityPriv: privKey,
|
||||
lightningID: fastsha256.Sum256(serializedPubKey),
|
||||
@@ -104,8 +104,6 @@ func newServer(listenAddrs []string, notifier chainntnfs.ChainNotifier,
|
||||
quit: make(chan struct{}),
|
||||
}
|
||||
|
||||
// TODO(roasbeef): remove
|
||||
s.invoices.addInvoice(1000*1e8, *debugPre)
|
||||
|
||||
s.utxoNursery = newUtxoNursery(notifier, wallet)
|
||||
|
||||
|
||||
Reference in new issue
Block a user