sweep: add time-based sweeper

In this commit, the sweep package is extended from just tx generation to
an active sweeper that collects sweep inputs and autonomously proceeds
to publish the sweep tx after the batch window time interval has passed
without new inputs being added.
This commit is contained in:
Joost Jager
2018-10-23 12:05:48 +02:00
parent 1f0656559e
commit 01e64afd56
3 changed files with 754 additions and 11 deletions

14
sweep/defaults.go Normal file
View File

@ -0,0 +1,14 @@
// +build !rpctest
package sweep
import (
"time"
)
var (
// DefaultBatchWindowDuration specifies 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.
DefaultBatchWindowDuration = 30 * time.Second
)