diff options
| author | Gavin Andresen <[email protected]> | 2012-03-22 09:18:11 -0700 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2012-03-22 09:18:11 -0700 |
| commit | e12d1317348c22368f032d2d09ea9cc2ac997a72 (patch) | |
| tree | 76311a7f66fbb8aa0c4083fdc93de43e0024963e /src/db.cpp | |
| parent | Merge branch 'addrman' of https://github.com/sipa/bitcoin (diff) | |
| parent | Check minversion before loading the rest of the wallet (diff) | |
| download | discoin-e12d1317348c22368f032d2d09ea9cc2ac997a72.tar.xz discoin-e12d1317348c22368f032d2d09ea9cc2ac997a72.zip | |
Merge pull request #975 from sipa/versioncheck
Check minversion before loading the rest of the wallet
Diffstat (limited to 'src/db.cpp')
| -rw-r--r-- | src/db.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/db.cpp b/src/db.cpp index 3bdfd6455..4e1b95980 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -799,6 +799,14 @@ 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 > CLIENT_VERSION) + return DB_TOO_NEW; + pwallet->LoadMinVersion(nMinVersion); + } + // Get cursor Dbc* pcursor = GetCursor(); if (!pcursor) @@ -968,14 +976,6 @@ int CWalletDB::LoadWallet(CWallet* pwallet) if (nFileVersion == 10300) nFileVersion = 300; } - else if (strType == "minversion") - { - int nMinVersion = 0; - ssValue >> nMinVersion; - if (nMinVersion > CLIENT_VERSION) - return DB_TOO_NEW; - pwallet->LoadMinVersion(nMinVersion); - } else if (strType == "cscript") { uint160 hash; |