X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fdb.cpp;h=d509253e4e2d10fdec348fec1a2602cdea522ab2;hb=b6862f7b74d0ea7442cf3b9eec7b9556ca47ce4b;hp=68d317106da206bf1e22595da99a022b7b2aff31;hpb=8a39b0d613e6d79b7118eb929b5fe68220584f07;p=novacoin.git diff --git a/src/db.cpp b/src/db.cpp index 68d3171..d509253 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();