X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fdb.cpp;h=d615e46862305f220a43a536d5809ad7bc9e8d38;hp=02b3327bee7ea5a1bed96c3a4045d7abba36959c;hb=3b36da6d277c6f5ad671343e724e0336ce55c893;hpb=087fc28f7d4e82a0b79dabbaa19358e48d3084fe diff --git a/src/db.cpp b/src/db.cpp index 02b3327..d615e46 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -390,9 +390,15 @@ bool CTxDB::ReadOwnerTxes(uint160 hash160, int nMinHeight, vector& string strType; uint160 hashItem; CDiskTxPos pos; - ssKey >> strType >> hashItem >> pos; int nItemHeight; - ssValue >> nItemHeight; + + try { + ssKey >> strType >> hashItem >> pos; + ssValue >> nItemHeight; + } + catch (std::exception &e) { + return error("%s() : deserialize error", __PRETTY_FUNCTION__); + } // Read transaction if (strType != "owner" || hashItem != hash160) @@ -512,6 +518,8 @@ bool CTxDB::LoadBlockIndex() return false; // Unserialize + + try { string strType; ssKey >> strType; if (strType == "blockindex") @@ -543,6 +551,10 @@ bool CTxDB::LoadBlockIndex() { break; } + } // try + catch (std::exception &e) { + return error("%s() : deserialize error", __PRETTY_FUNCTION__); + } } pcursor->close();