multi: update to latest ChainNotifier impl New method

This commit is contained in:
Wilmer Paulino 2018-12-06 21:14:10 -08:00
parent 969acf6145
commit c72da48111
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F
3 changed files with 11 additions and 12 deletions

@ -1777,14 +1777,16 @@ func TestInterfaces(t *testing.T) {
) )
newNotifier = func() (chainntnfs.TestChainNotifier, error) { newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return bitcoindnotify.New( return bitcoindnotify.New(
bitcoindConn, hintCache, hintCache, bitcoindConn, chainntnfs.NetParams,
hintCache, hintCache,
), nil ), nil
} }
case "btcd": case "btcd":
newNotifier = func() (chainntnfs.TestChainNotifier, error) { newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return btcdnotify.New( return btcdnotify.New(
&rpcConfig, hintCache, hintCache, &rpcConfig, chainntnfs.NetParams,
hintCache, hintCache,
) )
} }
@ -1796,7 +1798,7 @@ func TestInterfaces(t *testing.T) {
newNotifier = func() (chainntnfs.TestChainNotifier, error) { newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return neutrinonotify.New( return neutrinonotify.New(
spvNode, hintCache, hintCache, spvNode, hintCache, hintCache,
) ), nil
} }
} }

@ -256,12 +256,7 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
// Next we'll create the instances of the ChainNotifier and // Next we'll create the instances of the ChainNotifier and
// FilteredChainView interface which is backed by the neutrino // FilteredChainView interface which is backed by the neutrino
// light client. // light client.
cc.chainNotifier, err = neutrinonotify.New( cc.chainNotifier = neutrinonotify.New(svc, hintCache, hintCache)
svc, hintCache, hintCache,
)
if err != nil {
return nil, nil, err
}
cc.chainView, err = chainview.NewCfFilteredChainView(svc) cc.chainView, err = chainview.NewCfFilteredChainView(svc)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
@ -336,7 +331,7 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
} }
cc.chainNotifier = bitcoindnotify.New( cc.chainNotifier = bitcoindnotify.New(
bitcoindConn, hintCache, hintCache, bitcoindConn, activeNetParams.Params, hintCache, hintCache,
) )
cc.chainView = chainview.NewBitcoindFilteredChainView(bitcoindConn) cc.chainView = chainview.NewBitcoindFilteredChainView(bitcoindConn)
walletConfig.ChainSource = bitcoindConn.NewBitcoindClient() walletConfig.ChainSource = bitcoindConn.NewBitcoindClient()
@ -446,7 +441,7 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
DisableAutoReconnect: false, DisableAutoReconnect: false,
} }
cc.chainNotifier, err = btcdnotify.New( cc.chainNotifier, err = btcdnotify.New(
rpcConfig, hintCache, hintCache, rpcConfig, activeNetParams.Params, hintCache, hintCache,
) )
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err

@ -2362,7 +2362,9 @@ func TestLightningWallet(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("unable to create height hint cache: %v", err) t.Fatalf("unable to create height hint cache: %v", err)
} }
chainNotifier, err := btcdnotify.New(&rpcConfig, hintCache, hintCache) chainNotifier, err := btcdnotify.New(
&rpcConfig, netParams, hintCache, hintCache,
)
if err != nil { if err != nil {
t.Fatalf("unable to create notifier: %v", err) t.Fatalf("unable to create notifier: %v", err)
} }