aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-07-21 21:19:02 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-07-27 15:56:57 +0200
commitf142c11ac634df487cc4bc65a5f1c9a3e3563dd9 (patch)
tree40561d6272632e4b8ff22583c48cfe5b2bece953 /src/wallet/wallet.cpp
parent18b8ee1cd1b2c95faac53e49b9023200679f2bb1 (diff)
downloadbitcoin-f142c11ac634df487cc4bc65a5f1c9a3e3563dd9.tar.xz
[0.13] Create a new HD seed after encrypting the wallet
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 5908dfeace..a1d9c4a598 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -626,6 +626,15 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
Lock();
Unlock(strWalletPassphrase);
+
+ // if we are using HD, replace the HD master key with a new one
+ if (!hdChain.masterKeyID.IsNull()) {
+ CKey key;
+ key.MakeNewKey(true);
+ if (!SetHDMasterKey(key))
+ return false;
+ }
+
NewKeyPool();
Lock();