Merge branch '0.4.x' into 0.5.0.x

This commit is contained in:
Luke Dashjr
2012-03-26 20:06:55 -04:00
3 changed files with 17 additions and 10 deletions

View File

@@ -777,6 +777,13 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
//// todo: shouldn't we catch exceptions and try to recover and continue?
CRITICAL_BLOCK(pwallet->cs_wallet)
{
int nMinVersion = 0;
if (Read((string)"minversion", nMinVersion))
{
if (nMinVersion > VERSION)
return DB_TOO_NEW;
}
// Get cursor
Dbc* pcursor = GetCursor();
if (!pcursor)
@@ -962,13 +969,6 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
if (strKey == "addrProxy") ssValue >> addrProxy;
if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP;
}
else if (strType == "minversion")
{
int nMinVersion = 0;
ssValue >> nMinVersion;
if (nMinVersion > VERSION)
return DB_TOO_NEW;
}
}
pcursor->close();
}