sweep: use bbolt DB directly instead of channeldb
This commit is contained in:
parent
4190146066
commit
b6dda143d0
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user