server+lncfg: make sweepr batch window duration configurable

This commit is contained in:
yyforyongyu
2022-08-29 10:25:51 +08:00
parent 1aa4d047fe
commit 2f27a52f7f
4 changed files with 34 additions and 1 deletions

19
lncfg/sweeper.go Normal file
View File

@@ -0,0 +1,19 @@
package lncfg
import (
"fmt"
"time"
)
type Sweeper struct {
BatchWindowDuration time.Duration `long:"batchwindowduration" description:"Duration of the sweep batch window. The sweep is held back during the batch window to allow more inputs to be added and thereby lower the fee per input."`
}
// Validate checks the values configured for the sweeper.
func (s *Sweeper) Validate() error {
if s.BatchWindowDuration < 0 {
return fmt.Errorf("batchwindowduration must be positive")
}
return nil
}