chainregistry: initialize wallet w/ recovery window

This commit is contained in:
Conner Fromknecht committed 2018-04-26 16:03:27 -07:00
1 parent 0ae62c3720
commit 1972a795e5
1 file changed
+13 -8
+13 -8
View File
@@ -112,7 +112,8 @@ type chainControl struct {
// branches of chainControl instances exist: one backed by a running btcd // branches of chainControl instances exist: one backed by a running btcd
// full-node, and the other backed by a running neutrino light client instance. // full-node, and the other backed by a running neutrino light client instance.
func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB, func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
privateWalletPw, publicWalletPw []byte) (*chainControl, func(), error) { privateWalletPw, publicWalletPw []byte, birthday time.Time,
recoveryWindow uint32) (*chainControl, func(), error) {
// Set the RPC config from the "home" chain. Multi-chain isn't yet // 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. // active, so we'll restrict usage to a particular chain for now.
@@ -152,12 +153,14 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
} }
walletConfig := &btcwallet.Config{ walletConfig := &btcwallet.Config{
PrivatePass: privateWalletPw, PrivatePass: privateWalletPw,
PublicPass: publicWalletPw, PublicPass: publicWalletPw,
DataDir: homeChainConfig.ChainDir, Birthday: birthday,
NetParams: activeNetParams.Params, RecoveryWindow: recoveryWindow,
FeeEstimator: cc.feeEstimator, DataDir: homeChainConfig.ChainDir,
CoinType: activeNetParams.CoinType, NetParams: activeNetParams.Params,
FeeEstimator: cc.feeEstimator,
CoinType: activeNetParams.CoinType,
} }
var ( var (
@@ -243,7 +246,9 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
// Finally, we'll set the chain source for btcwallet, and // Finally, we'll set the chain source for btcwallet, and
// create our clean up function which simply closes the // create our clean up function which simply closes the
// database. // database.
walletConfig.ChainSource = chain.NewNeutrinoClient(svc) walletConfig.ChainSource = chain.NewNeutrinoClient(
activeNetParams.Params, svc,
)
cleanUp = func() { cleanUp = func() {
svc.Stop() svc.Stop()
nodeDatabase.Close() nodeDatabase.Close()