chainregistry: take wallet password as parameter to newChainControlFromConfig

This let the caller of newChainControlFromConfig set the password
to be used when creating or unlocking the wallet database. The
provided password is used both as private and public password.
This commit is contained in:
Johan T. Halseth 2017-10-12 11:22:33 +02:00 committed by Olaoluwa Osuntokun
parent f1c7dc1cbd
commit 62dc6b81d2

View File

@ -102,7 +102,8 @@ type chainControl struct {
// according to the parameters in the passed lnd configuration. Currently two
// branches of chainControl instances exist: one backed by a running btcd
// full-node, and the other backed by a running neutrino light client instance.
func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB) (*chainControl, func(), error) {
func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
walletPw []byte) (*chainControl, func(), error) {
// Set the RPC config from the "home" chain. Multi-chain isn't yet
// active, so we'll restrict usage to a particular chain for now.
homeChainConfig := cfg.Bitcoin
@ -131,7 +132,8 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB) (*chainControl
}
walletConfig := &btcwallet.Config{
PrivatePass: []byte("hello"),
PrivatePass: walletPw,
PublicPass: walletPw,
DataDir: homeChainConfig.ChainDir,
NetParams: activeNetParams.Params,
FeeEstimator: cc.feeEstimator,