X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.cpp;h=bf335e7e3fd4f0b2e6817f7c408f49cce552e1bd;hb=fea0a27ddc30f2d51c386d268499d6c50363c202;hp=7f9439bf7456cc0bfc99808a04b246d4a783aaf9;hpb=04dc79f1cc19b48531cc9a16ca502eac34d7e95b;p=novacoin.git diff --git a/src/db.cpp b/src/db.cpp index 7f9439b..bf335e7 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -795,6 +795,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) @@ -980,13 +987,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(); }