X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fdb.cpp;h=2d9d552467630142a3d60a78ad861159fc4521ac;hp=4d2965fac9633be2d59ec4e4f186875906baa250;hb=a49927a46d578d142411c52b17c6f11bb19da03d;hpb=d7534272c62583320dc8d4a1ea71a41c715ef559 diff --git a/src/db.cpp b/src/db.cpp index 4d2965f..2d9d552 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -410,9 +410,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) @@ -532,6 +538,8 @@ bool CTxDB::LoadBlockIndex() return false; // Unserialize + + try { string strType; ssKey >> strType; if (strType == "blockindex" && !fRequestShutdown) @@ -563,6 +571,10 @@ bool CTxDB::LoadBlockIndex() { break; // if shutdown requested or finished loading block index } + } // try + catch (std::exception &e) { + return error("%s() : deserialize error", __PRETTY_FUNCTION__); + } } pcursor->close();