lnwallet: update btcwallet and chain.Client to new upstream API's
A major change for btcwallet adding a new RPC wallet, refactoring parts of the wallet, and introducing new functionality has been introduced. This commit updates lnwallet to the API changes. A future commit will change lnwallet to use some of the new functionality such as the notification server, etc.
This commit is contained in:
parent
034cbef66d
commit
80ce49a883
@ -213,14 +213,13 @@ type LightningWallet struct {
|
|||||||
|
|
||||||
// The core wallet, all non Lightning Network specific interaction is
|
// The core wallet, all non Lightning Network specific interaction is
|
||||||
// proxied to the internal wallet.
|
// proxied to the internal wallet.
|
||||||
// TODO(roasbeef): Why isn't this just embedded again?
|
|
||||||
*btcwallet.Wallet
|
*btcwallet.Wallet
|
||||||
|
|
||||||
// An active RPC connection to a full-node. In the case of a btcd node,
|
// An active RPC connection to a full-node. In the case of a btcd node,
|
||||||
// websockets are used for notifications. If using Bitcoin Core,
|
// websockets are used for notifications. If using Bitcoin Core,
|
||||||
// notifications are either generated via long-polling or the usage of
|
// notifications are either generated via long-polling or the usage of
|
||||||
// ZeroMQ.
|
// ZeroMQ.
|
||||||
rpc *chain.Client
|
rpc *chain.RPCClient
|
||||||
|
|
||||||
// All messages to the wallet are to be sent accross this channel.
|
// All messages to the wallet are to be sent accross this channel.
|
||||||
msgChan chan interface{}
|
msgChan chan interface{}
|
||||||
@ -349,8 +348,8 @@ func (l *LightningWallet) Startup() error {
|
|||||||
}
|
}
|
||||||
// TODO(roasbeef): config...
|
// TODO(roasbeef): config...
|
||||||
|
|
||||||
rpcc, err := chain.NewClient(ActiveNetParams,
|
rpcc, err := chain.NewRPCClient(ActiveNetParams, l.cfg.RpcHost,
|
||||||
l.cfg.RpcHost, l.cfg.RpcUser, l.cfg.RpcPass, l.cfg.CACert, false)
|
l.cfg.RpcUser, l.cfg.RpcPass, l.cfg.CACert, false, 20)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -360,8 +359,11 @@ func (l *LightningWallet) Startup() error {
|
|||||||
if err := l.rpc.Start(); err != nil {
|
if err := l.rpc.Start(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
l.Start()
|
||||||
|
|
||||||
l.Start(rpcc)
|
// Pass the rpc client into the wallet so it can sync up to the current
|
||||||
|
// main chain.
|
||||||
|
l.SynchronizeRPC(l.rpc)
|
||||||
|
|
||||||
l.wg.Add(1)
|
l.wg.Add(1)
|
||||||
// TODO(roasbeef): multiple request handlers?
|
// TODO(roasbeef): multiple request handlers?
|
||||||
|
Loading…
Reference in New Issue
Block a user