mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
lnd: introduce the InvoiceRegistry
This commit introduces the invoice registry which is a central repository of all outstanding invoices related to the daemon. This registry will be used by the goroutines which manage the htlc’s for a particular channel, and later by the point-to-point workflow which negotiates the conditions for payment along with signed recipes.
This commit is contained in:
@@ -46,6 +46,7 @@ type server struct {
|
||||
chanDB *channeldb.DB
|
||||
|
||||
htlcSwitch *htlcSwitch
|
||||
invoices *invoiceRegistry
|
||||
|
||||
newPeers chan *peer
|
||||
donePeers chan *peer
|
||||
@@ -78,6 +79,7 @@ func newServer(listenAddrs []string, wallet *lnwallet.LightningWallet,
|
||||
chanDB: chanDB,
|
||||
fundingMgr: newFundingManager(wallet),
|
||||
htlcSwitch: newHtlcSwitch(),
|
||||
invoices: newInvoiceRegistry(),
|
||||
lnwallet: wallet,
|
||||
identityPriv: privKey,
|
||||
lightningID: fastsha256.Sum256(serializedPubKey),
|
||||
@@ -89,6 +91,9 @@ func newServer(listenAddrs []string, wallet *lnwallet.LightningWallet,
|
||||
quit: make(chan struct{}),
|
||||
}
|
||||
|
||||
// TODO(roasbeef): remove
|
||||
s.invoices.addInvoice(1000*1e8, *debugPre)
|
||||
|
||||
s.rpcServer = newRpcServer(s)
|
||||
|
||||
return s, nil
|
||||
|
||||
Reference in New Issue
Block a user