lnwallet: use the ChainNotifier interface throughout instead of BtcdNotifier

This commit refactors the code within lnwallet interacting with the
ChainNotifier to accept, and call against the implementation rather
than a single concrete implementation.

LightningWallet no longer creates it’s own BtcdNotifier implementation
doing construction, now instead accepting a pre-started `ChainNotifier`
interface.  All imports have been updated to reflect the new naming
scheme.
This commit is contained in:
Olaoluwa Osuntokun committed 2016-09-01 19:13:19 -07:00
1 parent 366d076eda
commit 8bbd010f74
4 files changed
+28 -46

No files matched your search

+10 -1
View File
@@ -11,6 +11,7 @@ import (
"time"
"github.com/boltdb/bolt"
"github.com/lightningnetwork/lnd/chainntnfs/btcdnotify"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/roasbeef/btcd/chaincfg"
"github.com/roasbeef/btcutil/txsort"
@@ -338,7 +339,15 @@ func createTestWallet(miningNode *rpctest.Harness, netParams *chaincfg.Params) (
return "", nil, err
}
wallet, err := NewLightningWallet(config, cdb)
chainNotifier, err := btcdnotify.New(&rpcConfig)
if err != nil {
return "", nil, err
}
if err := chainNotifier.Start(); err != nil {
return "", nil, err
}
wallet, err := NewLightningWallet(config, cdb, chainNotifier)
if err != nil {
return "", nil, err
}