aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2011-07-12 19:34:30 -0700
committerJeff Garzik <jgarzik@exmulti.com>2011-07-12 19:34:30 -0700
commit0fa89d8e816807a621419495d7bdc6366979a0f0 (patch)
tree32327a402bb77104f74738c2a10022c8938db252 /src/db.cpp
parent61e3c011f5506b4ebd0014e49ea8b61ae916d20d (diff)
parent7ec552676c66488fe00fb503d02ec4a389a715b7 (diff)
Merge pull request #381 from TheBlueMatt/nminversion
Add minversion to wallet.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/db.cpp b/src/db.cpp
index ebe7e3a8f6..1dea92eadc 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -670,7 +670,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
}
-bool CWalletDB::LoadWallet(CWallet* pwallet)
+int CWalletDB::LoadWallet(CWallet* pwallet)
{
pwallet->vchDefaultKey.clear();
int nFileVersion = 0;
@@ -690,7 +690,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
// Get cursor
Dbc* pcursor = GetCursor();
if (!pcursor)
- return false;
+ return DB_CORRUPT;
loop
{
@@ -701,7 +701,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
if (ret == DB_NOTFOUND)
break;
else if (ret != 0)
- return false;
+ return DB_CORRUPT;
// Unserialize
// Taking advantage of the fact that pair serialization
@@ -836,6 +836,13 @@ bool 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();
}
@@ -865,7 +872,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet)
}
- return true;
+ return DB_LOAD_OK;
}
void ThreadFlushWalletDB(void* parg)