X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.cpp;h=6c5e7918c874df8ab72fac69c07a43cb9afa109f;hb=d67b0434f24a629372000b0bd573ea9013ca3d90;hp=2dddcf095a0e59d6e4fb2c2c2bb948ff2cc4b77a;hpb=d11488abd05cb39a9f481e7c4c35f780197a3d28;p=novacoin.git diff --git a/src/db.cpp b/src/db.cpp index 2dddcf0..6c5e791 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -405,9 +405,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) @@ -527,6 +533,8 @@ bool CTxDB::LoadBlockIndex() return false; // Unserialize + + try { string strType; ssKey >> strType; if (strType == "blockindex") @@ -558,6 +566,10 @@ bool CTxDB::LoadBlockIndex() { break; } + } // try + catch (std::exception &e) { + return error("%s() : deserialize error", __PRETTY_FUNCTION__); + } } pcursor->close();