aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-05-22 22:57:10 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-05-22 22:57:10 +0000
commitd67b0434f24a629372000b0bd573ea9013ca3d90 (patch)
treea6de445d36ec2854c8fa6c63180c7f7ee1acbbd4 /src/db.cpp
parentd11488abd05cb39a9f481e7c4c35f780197a3d28 (diff)
parent3b36da6d277c6f5ad671343e724e0336ce55c893 (diff)
downloadbitcoin-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.cpp16
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();