mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 02:02:10 +02:00
multi: add new config option BudgetConfig
and NoDeadlineConfTarget
This commit adds a new group config `BudgetConfig` to allow users specifying their own preference when sweeping outputs. And a new config option `NoDeadlineConfTarget` is added in case the user wants to use a different "lazy" conf target.
This commit is contained in:
@@ -38,8 +38,6 @@ var (
|
||||
|
||||
// DefaultDeadlineDelta defines a default deadline delta (1 week) to be
|
||||
// used when sweeping inputs with no deadline pressure.
|
||||
//
|
||||
// TODO(yy): make this configurable.
|
||||
DefaultDeadlineDelta = int32(1008)
|
||||
)
|
||||
|
||||
@@ -372,6 +370,10 @@ type UtxoSweeperConfig struct {
|
||||
// Publisher is used to publish the sweep tx crafted here and monitors
|
||||
// it for potential fee bumps.
|
||||
Publisher Bumper
|
||||
|
||||
// NoDeadlineConfTarget is the conf target to use when sweeping
|
||||
// non-time-sensitive outputs.
|
||||
NoDeadlineConfTarget uint32
|
||||
}
|
||||
|
||||
// Result is the struct that is pushed through the result channel. Callers can
|
||||
@@ -1551,7 +1553,7 @@ func (s *UtxoSweeper) updateSweeperInputs() InputsMap {
|
||||
func (s *UtxoSweeper) sweepPendingInputs(inputs InputsMap) {
|
||||
// Create a default deadline height, which will be used when there's no
|
||||
// DeadlineHeight specified for a given input.
|
||||
defaultDeadline := s.currentHeight + DefaultDeadlineDelta
|
||||
defaultDeadline := s.currentHeight + int32(s.cfg.NoDeadlineConfTarget)
|
||||
|
||||
// Cluster all of our inputs based on the specific Aggregator.
|
||||
sets := s.cfg.Aggregator.ClusterInputs(inputs, defaultDeadline)
|
||||
|
@@ -2677,6 +2677,7 @@ func TestSweepPendingInputs(t *testing.T) {
|
||||
GenSweepScript: func() ([]byte, error) {
|
||||
return testPubKey.SerializeCompressed(), nil
|
||||
},
|
||||
NoDeadlineConfTarget: uint32(DefaultDeadlineDelta),
|
||||
})
|
||||
|
||||
// Set a current height to test the deadline override.
|
||||
|
Reference in New Issue
Block a user