// MinBudgetValue is the minimal budget that we allow when configuring
// the budget used in sweeping outputs. The actual budget can be lower
// if the user decides to NOT set this value.
//
// NOTE: This value is chosen so the linear fee function can increase
// at least 1 sat/kw per block.
MinBudgetValuebtcutil.Amount=1008
// MinBudgetRatio is the minimal ratio that we allow when configuring
// the budget ratio used in sweeping outputs.
MinBudgetRatio=0.001
// DefaultBudgetRatio defines a default budget ratio to be used when
// sweeping inputs. This is a large value, which is fine as the final
// fee rate is capped at the max fee rate configured.
DefaultBudgetRatio=0.5
)
// BudgetConfig is a struct that holds the configuration when offering outputs
// to the sweeper.
//
//nolint:lll
typeBudgetConfigstruct{
ToLocalbtcutil.Amount`long:"tolocal" description:"The amount in satoshis to allocate as the budget to pay fees when sweeping the to_local output. If set, the budget calculated using the ratio (if set) will be capped at this value."`
ToLocalRatiofloat64`long:"tolocalratio" description:"The ratio of the value in to_local output to allocate as the budget to pay fees when sweeping it."`
AnchorCPFPbtcutil.Amount`long:"anchorcpfp" description:"The amount in satoshis to allocate as the budget to pay fees when CPFPing a force close tx using the anchor output. If set, the budget calculated using the ratio (if set) will be capped at this value."`
AnchorCPFPRatiofloat64`long:"anchorcpfpratio" description:"The ratio of a special value to allocate as the budget to pay fees when CPFPing a force close tx using the anchor output. The special value is the sum of all time-sensitive HTLCs on this commitment subtracted by their budgets."`
DeadlineHTLCbtcutil.Amount`long:"deadlinehtlc" description:"The amount in satoshis to allocate as the budget to pay fees when sweeping a time-sensitive (first-level) HTLC. If set, the budget calculated using the ratio (if set) will be capped at this value."`
DeadlineHTLCRatiofloat64`long:"deadlinehtlcratio" description:"The ratio of the value in a time-sensitive (first-level) HTLC to allocate as the budget to pay fees when sweeping it."`
NoDeadlineHTLCbtcutil.Amount`long:"nodeadlinehtlc" description:"The amount in satoshis to allocate as the budget to pay fees when sweeping a non-time-sensitive (second-level) HTLC. If set, the budget calculated using the ratio (if set) will be capped at this value."`
NoDeadlineHTLCRatiofloat64`long:"nodeadlinehtlcratio" description:"The ratio of the value in a non-time-sensitive (second-level) HTLC to allocate as the budget to pay fees when sweeping it."`
}
// Validate checks the budget configuration for any invalid values.