diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2011-11-10 21:29:23 +0100 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-11-14 09:59:22 -0500 |
commit | 9e9869d0fe9c5cb38273a557e28b1922356d0e11 (patch) | |
tree | 243d112805483871364e320f2bffc300f95f8829 /src/wallet.cpp | |
parent | e6a729d2d82d9bc092ace2836f7492106003cbf0 (diff) |
Resilvering
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 64ee5c3b8c..3ed880f600 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -189,6 +189,9 @@ bool CWallet::EncryptWallet(const string& strWalletPassphrase) Lock(); } + if (Resilver(strWalletFile)) + CWalletDB(strWalletFile, "r+").WriteSetting("fIsResilvered", true); + return true; } @@ -1142,6 +1145,13 @@ int CWallet::LoadWallet(bool& fFirstRunRet) return false; fFirstRunRet = false; int nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this); + if (nLoadWalletRet == DB_NEED_RESILVER) + { + if (Resilver(strWalletFile)) + CWalletDB(strWalletFile, "r+").WriteSetting("fIsResilvered", true); + nLoadWalletRet = DB_LOAD_OK; + } + if (nLoadWalletRet != DB_LOAD_OK) return nLoadWalletRet; fFirstRunRet = vchDefaultKey.empty(); |