diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2012-05-22 22:57:10 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-05-22 22:57:10 +0000 |
commit | d67b0434f24a629372000b0bd573ea9013ca3d90 (patch) | |
tree | a6de445d36ec2854c8fa6c63180c7f7ee1acbbd4 /src/db.cpp | |
parent | d11488abd05cb39a9f481e7c4c35f780197a3d28 (diff) | |
parent | 3b36da6d277c6f5ad671343e724e0336ce55c893 (diff) | |
download | bitcoin-d67b0434f24a629372000b0bd573ea9013ca3d90.tar.xz |
Merge branch '0.5.x' into 0.6.0.x
Conflicts:
src/main.cpp
Diffstat (limited to 'src/db.cpp')
-rw-r--r-- | src/db.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/db.cpp b/src/db.cpp index 2dddcf095a..6c5e7918c8 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -405,9 +405,15 @@ bool CTxDB::ReadOwnerTxes(uint160 hash160, int nMinHeight, vector<CTransaction>& 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(); |