sweep: use bbolt DB directly instead of channeldb

This commit is contained in:
Oliver Gugger 2019-10-07 13:20:09 +02:00
parent 4190146066
commit b6dda143d0
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
3 changed files with 4 additions and 5 deletions

@ -764,7 +764,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB,
sweep.DefaultBatchWindowDuration)
sweeperStore, err := sweep.NewSweeperStore(
chanDB, activeNetParams.GenesisHash,
chanDB.DB, activeNetParams.GenesisHash,
)
if err != nil {
srvrLog.Errorf("unable to create sweeper store: %v", err)

@ -9,7 +9,6 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/coreos/bbolt"
"github.com/lightningnetwork/lnd/channeldb"
)
var (
@ -57,11 +56,11 @@ type SweeperStore interface {
}
type sweeperStore struct {
db *channeldb.DB
db *bbolt.DB
}
// NewSweeperStore returns a new store instance.
func NewSweeperStore(db *channeldb.DB, chainHash *chainhash.Hash) (
func NewSweeperStore(db *bbolt.DB, chainHash *chainhash.Hash) (
SweeperStore, error) {
err := db.Update(func(tx *bbolt.Tx) error {

@ -53,7 +53,7 @@ func TestStore(t *testing.T) {
testStore(t, func() (SweeperStore, error) {
var chain chainhash.Hash
return NewSweeperStore(cdb, &chain)
return NewSweeperStore(cdb.DB, &chain)
})
})
t.Run("mock", func(t *testing.T) {