From 62dc6b81d2a75cf707a953c5564050ca01495d06 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Thu, 12 Oct 2017 11:22:33 +0200 Subject: [PATCH] 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. --- chainregistry.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chainregistry.go b/chainregistry.go index 68dc197a..4e4baf86 100644 --- a/chainregistry.go +++ b/chainregistry.go @@ -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,