Versions in this module Expand all Collapse all v0 v0.5.1 Feb 26, 2020 Changes in this version + const DefaultFeeRateBucketSize + const DefaultMaxFeeRate + var DefaultBatchWindowDuration = 30 * time.Second + var DefaultMaxInputsPerTx = 100 + var DefaultMaxSweepAttempts = 10 + var ErrExclusiveGroupSpend = errors.New(...) + var ErrNoFeePreference = errors.New("no fee preference specified") + var ErrRemoteSpend = errors.New("remote party swept utxo") + var ErrSweeperShuttingDown = errors.New("utxo sweeper shutting down") + var ErrTooManyAttempts = errors.New("sweep failed after max attempts") + func DefaultNextAttemptDeltaFunc(attempts int) int32 + func DetermineFeePerKw(feeEstimator chainfee.Estimator, feePref FeePreference) (chainfee.SatPerKWeight, error) + func DisableLog() + func UseLogger(logger btclog.Logger) + type CoinSelectionLocker interface + WithCoinSelectLock func(func() error) error + type FeePreference struct + ConfTarget uint32 + FeeRate chainfee.SatPerKWeight + func (p FeePreference) String() string + type MockNotifier struct + func NewMockNotifier(t *testing.T) *MockNotifier + func (m *MockNotifier) ConfirmTx(txid *chainhash.Hash, height uint32) error + func (m *MockNotifier) NotifyEpoch(height int32) + func (m *MockNotifier) RegisterBlockEpochNtfn(bestBlock *chainntnfs.BlockEpoch) (*chainntnfs.BlockEpochEvent, error) + func (m *MockNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash, _ []byte, numConfs, heightHint uint32) (*chainntnfs.ConfirmationEvent, error) + func (m *MockNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint, _ []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) + func (m *MockNotifier) SpendOutpoint(outpoint wire.OutPoint, spendingTx wire.MsgTx) + func (m *MockNotifier) Start() error + func (m *MockNotifier) Stop() error + type MockSweeperStore struct + func NewMockSweeperStore() *MockSweeperStore + func (s *MockSweeperStore) GetLastPublishedTx() (*wire.MsgTx, error) + func (s *MockSweeperStore) IsOurTx(hash chainhash.Hash) (bool, error) + func (s *MockSweeperStore) NotifyPublishTx(tx *wire.MsgTx) error + type OutpointLocker interface + LockOutpoint func(o wire.OutPoint) + UnlockOutpoint func(o wire.OutPoint) + type Params struct + ExclusiveGroup *uint64 + Fee FeePreference + Force bool + func (p Params) String() string + type PendingInput struct + Amount btcutil.Amount + BroadcastAttempts int + LastFeeRate chainfee.SatPerKWeight + NextBroadcastHeight uint32 + OutPoint wire.OutPoint + Params Params + WitnessType input.WitnessType + type Result struct + Err error + Tx *wire.MsgTx + type SweeperStore interface + GetLastPublishedTx func() (*wire.MsgTx, error) + IsOurTx func(hash chainhash.Hash) (bool, error) + NotifyPublishTx func(*wire.MsgTx) error + func NewSweeperStore(db *bbolt.DB, chainHash *chainhash.Hash) (SweeperStore, error) + type UtxoSource interface + ListUnspentWitness func(minConfs, maxConfs int32) ([]*lnwallet.Utxo, error) + type UtxoSweeper struct + func New(cfg *UtxoSweeperConfig) *UtxoSweeper + func (s *UtxoSweeper) CreateSweepTx(inputs []input.Input, feePref FeePreference, currentBlockHeight uint32) (*wire.MsgTx, error) + func (s *UtxoSweeper) PendingInputs() (map[wire.OutPoint]*PendingInput, error) + func (s *UtxoSweeper) Start() error + func (s *UtxoSweeper) Stop() error + func (s *UtxoSweeper) SweepInput(input input.Input, params Params) (chan Result, error) + func (s *UtxoSweeper) UpdateParams(input wire.OutPoint, params Params) (chan Result, error) + type UtxoSweeperConfig struct + FeeEstimator chainfee.Estimator + FeeRateBucketSize int + GenSweepScript func() ([]byte, error) + MaxFeeRate chainfee.SatPerKWeight + MaxInputsPerTx int + MaxSweepAttempts int + NewBatchTimer func() <-chan time.Time + NextAttemptDeltaFunc func(int) int32 + Notifier chainntnfs.ChainNotifier + Signer input.Signer + Store SweeperStore + Wallet Wallet + type Wallet interface + ListUnspentWitness func(minconfirms, maxconfirms int32) ([]*lnwallet.Utxo, error) + PublishTransaction func(tx *wire.MsgTx) error + WithCoinSelectLock func(f func() error) error + type WalletSweepPackage struct + CancelSweepAttempt func() + SweepTx *wire.MsgTx + func CraftSweepAllTx(feeRate chainfee.SatPerKWeight, blockHeight uint32, ...) (*WalletSweepPackage, error)