multi: extract wallet initialization

With this commit we extract the wallet creation/unlocking and
initialization completely out of the main function. This will allow us
to use custom implementations in the future.
This commit is contained in:
Oliver Gugger
2021-09-23 16:54:43 +02:00
parent 047d8ea3bc
commit e1da1f8941
6 changed files with 460 additions and 372 deletions

View File

@@ -34,6 +34,7 @@ import (
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing/chainview"
"github.com/lightningnetwork/lnd/walletunlocker"
)
// Config houses necessary fields that a chainControl instance needs to
@@ -79,6 +80,10 @@ type Config struct {
// BlockCache is the main cache for storing block information.
BlockCache *blockcache.BlockCache
// WalletUnlockParams are the parameters that were used for unlocking
// the main wallet.
WalletUnlockParams *walletunlocker.WalletUnlockParams
// NeutrinoCS is a pointer to a neutrino ChainService. Must be non-nil if
// using neutrino.
NeutrinoCS *neutrino.ChainService