sweep: add list sweeps function

This commit is contained in:
carla
2020-05-05 21:10:11 +02:00
parent 537dac3c62
commit 99a45e968a
4 changed files with 74 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import (
"sync/atomic"
"time"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/davecgh/go-spew/spew"
@@ -1262,6 +1263,11 @@ func DefaultNextAttemptDeltaFunc(attempts int) int32 {
return 1 + rand.Int31n(1<<uint(attempts-1))
}
// ListSweeps returns a list of the the sweeps recorded by the sweep store.
func (s *UtxoSweeper) ListSweeps() ([]chainhash.Hash, error) {
return s.cfg.Store.ListSweeps()
}
// init initializes the random generator for random input rescheduling.
func init() {
rand.Seed(time.Now().Unix())