Resilvering

This commit is contained in:
Pieter Wuille
2011-11-15 10:03:31 -05:00
committed by Luke Dashjr
parent ef4280e08b
commit 00eae584a2
3 changed files with 104 additions and 1 deletions
+10
View File
@@ -190,6 +190,9 @@ bool CWallet::EncryptWallet(const string& strWalletPassphrase)
Lock();
}
if (Resilver(strWalletFile))
CWalletDB(strWalletFile, "r+").WriteSetting("fIsResilvered", true);
return true;
}
@@ -1122,6 +1125,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();