aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.cpp
diff options
context:
space:
mode:
authorAndrew Chow <[email protected]>2019-10-07 14:11:34 -0400
committerAndrew Chow <[email protected]>2019-11-01 22:58:05 -0400
commit0eac7088ab878372a72f85f9c5f7662a14199083 (patch)
tree1161592b4575e64b870b079c9b9104b73ed54d0e /src/wallet/scriptpubkeyman.cpp
parentRefactor: Move HavePrivateKeys code out of CWallet::CreateWalletFromFile (diff)
downloaddiscoin-0eac7088ab878372a72f85f9c5f7662a14199083.tar.xz
discoin-0eac7088ab878372a72f85f9c5f7662a14199083.zip
Refactor: Move SetupGeneration code out of CWallet
This commit does not change behavior.
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r--src/wallet/scriptpubkeyman.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp
index 9d90edeea..14e4163be 100644
--- a/src/wallet/scriptpubkeyman.cpp
+++ b/src/wallet/scriptpubkeyman.cpp
@@ -339,6 +339,19 @@ void LegacyScriptPubKeyMan::UpgradeKeyMetadata()
}
}
+bool LegacyScriptPubKeyMan::SetupGeneration(bool force)
+{
+ if ((CanGenerateKeys() && !force) || m_storage.IsLocked()) {
+ return false;
+ }
+
+ SetHDSeed(GenerateNewSeed());
+ if (!NewKeyPool()) {
+ return false;
+ }
+ return true;
+}
+
bool LegacyScriptPubKeyMan::IsHDEnabled() const
{
return !hdChain.seed_id.IsNull();