mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
cnct: create sweeper interface
This commit is contained in:
parent
919ab60540
commit
08c9db9725
2 changed files with 17 additions and 2 deletions
|
@ -15,7 +15,6 @@ import (
|
|||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/sweep"
|
||||
)
|
||||
|
||||
// ErrChainArbExiting signals that the chain arbitrator is shutting down.
|
||||
|
@ -141,7 +140,7 @@ type ChainArbitratorConfig struct {
|
|||
DisableChannel func(wire.OutPoint) error
|
||||
|
||||
// Sweeper allows resolvers to sweep their final outputs.
|
||||
Sweeper *sweep.UtxoSweeper
|
||||
Sweeper UtxoSweeper
|
||||
|
||||
// Registry is the invoice database that is used by resolvers to lookup
|
||||
// preimages and settle invoices.
|
||||
|
|
|
@ -3,11 +3,14 @@ package contractcourt
|
|||
import (
|
||||
"io"
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/invoices"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/sweep"
|
||||
)
|
||||
|
||||
// Registry is an interface which represents the invoice registry.
|
||||
|
@ -36,3 +39,16 @@ type OnionProcessor interface {
|
|||
// the passed io.Reader instance.
|
||||
ReconstructHopIterator(r io.Reader, rHash []byte) (hop.Iterator, error)
|
||||
}
|
||||
|
||||
// UtxoSweeper defines the sweep functions that contract court requires.
|
||||
type UtxoSweeper interface {
|
||||
// SweepInput sweeps inputs back into the wallet.
|
||||
SweepInput(input input.Input,
|
||||
feePreference sweep.FeePreference) (chan sweep.Result, error)
|
||||
|
||||
// CreateSweepTx accepts a list of inputs and signs and generates a txn
|
||||
// that spends from them. This method also makes an accurate fee
|
||||
// estimate before generating the required witnesses.
|
||||
CreateSweepTx(inputs []input.Input, feePref sweep.FeePreference,
|
||||
currentBlockHeight uint32) (*wire.MsgTx, error)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue