contractcourt: add access to full invoice registry from resolvers

Previously a function pointer was passed to chain arbitrator to avoid a
circular dependency. Now that the routetypes package exists, we can pass
the full invoice registry to chain arbitrator.

This is a preparation to be able to use other invoice registry methods
in contract resolvers.
This commit is contained in:
Joost Jager
2019-02-09 16:27:37 +01:00
parent 2be1051fb6
commit 449c3d533e
4 changed files with 7 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ import (
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/invoices"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/sweep"
@@ -137,10 +137,9 @@ type ChainArbitratorConfig struct {
// Sweeper allows resolvers to sweep their final outputs.
Sweeper *sweep.UtxoSweeper
// SettleInvoice attempts to settle an existing invoice on-chain with
// the given payment hash. ErrInvoiceNotFound is returned if an invoice
// is not found.
SettleInvoice func(lntypes.Hash, lnwire.MilliSatoshi) error
// Registry is the invoice database that is used by resolvers to lookup
// preimages and settle invoices.
Registry *invoices.InvoiceRegistry
// NotifyClosedChannel is a function closure that the ChainArbitrator
// will use to notify the ChannelNotifier about a newly closed channel.