2019-12-10 17:32:57 +03:00
|
|
|
package sweep
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/btcsuite/btcd/wire"
|
2019-12-10 18:06:45 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lnwallet"
|
2019-12-10 17:32:57 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// Wallet contains all wallet related functionality required by sweeper.
|
|
|
|
type Wallet interface {
|
|
|
|
// PublishTransaction performs cursory validation (dust checks, etc) and
|
|
|
|
// broadcasts the passed transaction to the Bitcoin network.
|
2020-05-18 15:13:23 +03:00
|
|
|
PublishTransaction(tx *wire.MsgTx, label string) error
|
2019-12-10 18:06:45 +03:00
|
|
|
|
2021-02-20 04:41:50 +03:00
|
|
|
// ListUnspentWitnessFromDefaultAccount returns all unspent outputs
|
|
|
|
// which are version 0 witness programs from the default wallet account.
|
|
|
|
// The 'minconfirms' and 'maxconfirms' parameters indicate the minimum
|
|
|
|
// and maximum number of confirmations an output needs in order to be
|
|
|
|
// returned by this method.
|
|
|
|
ListUnspentWitnessFromDefaultAccount(minconfirms, maxconfirms int32) (
|
|
|
|
[]*lnwallet.Utxo, error)
|
2019-12-10 18:06:45 +03:00
|
|
|
|
|
|
|
// WithCoinSelectLock will execute the passed function closure in a
|
|
|
|
// synchronized manner preventing any coin selection operations from
|
2020-03-19 07:43:49 +03:00
|
|
|
// proceeding while the closure is executing. This can be seen as the
|
2019-12-10 18:06:45 +03:00
|
|
|
// ability to execute a function closure under an exclusive coin
|
|
|
|
// selection lock.
|
|
|
|
WithCoinSelectLock(f func() error) error
|
2019-12-10 17:32:57 +03:00
|
|
|
}
|