Versions in this module Expand all Collapse all v0 v0.0.3 Sep 11, 2024 Changes in this version + const DefaultFeeRateBucketSize + var DefaultBatchWindowDuration = 30 * time.Second + var DefaultMaxFeeRate chainfee.SatPerVByte = 1e3 + var DefaultMaxInputsPerTx = 100 + var DefaultMaxSweepAttempts = 10 + var ErrExclusiveGroupSpend = errors.New(...) + var ErrFeePreferenceTooLow = errors.New("fee preference too low") + 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 DeliveryAddr struct + Addr btcutil.Address + Amt btcutil.Amount + 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) Started() bool + func (m *MockNotifier) Stop() error + type MockSweeperStore struct + func NewMockSweeperStore() *MockSweeperStore + func (s *MockSweeperStore) IsOurTx(hash chainhash.Hash) (bool, error) + func (s *MockSweeperStore) ListSweeps() ([]chainhash.Hash, error) + func (s *MockSweeperStore) NotifyPublishTx(tx *wire.MsgTx) error + type OutputLeaser interface + LeaseOutput func(i wtxmgr.LockID, o wire.OutPoint, d time.Duration) (time.Time, []byte, btcutil.Amount, error) + ReleaseOutput func(i wtxmgr.LockID, o wire.OutPoint) error + type Params struct + ExclusiveGroup *uint64 + Fee FeePreference + Force bool + func (p Params) String() string + type ParamsUpdate struct + Fee FeePreference + Force bool + 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 + IsOurTx func(hash chainhash.Hash) (bool, error) + ListSweeps func() ([]chainhash.Hash, error) + NotifyPublishTx func(*wire.MsgTx) error + func NewSweeperStore(db kvdb.Backend, chainHash *chainhash.Hash) (SweeperStore, error) + type UtxoSource interface + ListUnspentWitnessFromDefaultAccount 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) ListSweeps() ([]chainhash.Hash, error) + func (s *UtxoSweeper) PendingInputs() (map[wire.OutPoint]*PendingInput, error) + func (s *UtxoSweeper) RelayFeePerKW() chainfee.SatPerKWeight + 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 ParamsUpdate) (chan Result, error) + type UtxoSweeperConfig struct + DetermineFeePerKw feeDeterminer + FeeEstimator chainfee.Estimator + FeeRateBucketSize int + GenSweepScript func() ([]byte, error) + MaxFeeRate chainfee.SatPerVByte + MaxInputsPerTx int + MaxSweepAttempts int + NextAttemptDeltaFunc func(int) int32 + Notifier chainntnfs.ChainNotifier + Signer input.Signer + Store SweeperStore + TickerDuration time.Duration + Wallet Wallet + type Wallet interface + CancelRebroadcast func(tx chainhash.Hash) + FetchTx func(chainhash.Hash) (*wire.MsgTx, error) + ListUnspentWitnessFromDefaultAccount func(minConfs, maxConfs int32) ([]*lnwallet.Utxo, error) + PublishTransaction func(tx *wire.MsgTx, label string) error + RemoveDescendants func(*wire.MsgTx) error + WithCoinSelectLock func(f func() error) error + type WalletSweepPackage struct + CancelSweepAttempt func() + SweepTx *wire.MsgTx + func CraftSweepAllTx(feeRate, maxFeeRate chainfee.SatPerKWeight, blockHeight uint32, ...) (*WalletSweepPackage, error)