mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 05:08:13 +02:00
sweep: introduce BudgetInputSet
to manage budget-based inputs
This commit adds `BudgetInputSet` which implements `InputSet`. It handles the pending inputs based on the supplied budgets and will be used in the following commit.
This commit is contained in:
@@ -52,11 +52,22 @@ type Params struct {
|
||||
|
||||
// Force indicates whether the input should be swept regardless of
|
||||
// whether it is economical to do so.
|
||||
//
|
||||
// TODO(yy): Remove this param once deadline based sweeping is in place.
|
||||
Force bool
|
||||
|
||||
// ExclusiveGroup is an identifier that, if set, prevents other inputs
|
||||
// with the same identifier from being batched together.
|
||||
ExclusiveGroup *uint64
|
||||
|
||||
// DeadlineHeight specifies an absolute block height that this input
|
||||
// should be confirmed by. This value is used by the fee bumper to
|
||||
// decide its urgency and adjust its feerate used.
|
||||
DeadlineHeight fn.Option[int32]
|
||||
|
||||
// Budget specifies the maximum amount of satoshis that can be spent on
|
||||
// fees for this sweep.
|
||||
Budget btcutil.Amount
|
||||
}
|
||||
|
||||
// ParamsUpdate contains a new set of parameters to update a pending sweep with.
|
||||
@@ -196,6 +207,11 @@ type pendingInput struct {
|
||||
rbf fn.Option[RBFInfo]
|
||||
}
|
||||
|
||||
// String returns a human readable interpretation of the pending input.
|
||||
func (p *pendingInput) String() string {
|
||||
return fmt.Sprintf("%v (%v)", p.Input.OutPoint(), p.Input.WitnessType())
|
||||
}
|
||||
|
||||
// parameters returns the sweep parameters for this input.
|
||||
//
|
||||
// NOTE: Part of the txInput interface.
|
||||
|
Reference in New Issue
Block a user