aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-05-22 22:55:49 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-05-22 22:55:49 +0000
commit3b36da6d277c6f5ad671343e724e0336ce55c893 (patch)
tree1e3761e0276bc4ea9b571868f61c4ae7fce7c3e6 /src/db.cpp
parent087fc28f7d4e82a0b79dabbaa19358e48d3084fe (diff)
parenta2de1ea2d5776289c247bbc18c1ed13e16a4169f (diff)
downloadbitcoin-3b36da6d277c6f5ad671343e724e0336ce55c893.tar.xz
Merge branch '0.4.x' into 0.5.x
Conflicts: src/ui.cpp src/ui.h src/uibase.cpp src/xpm/about.xpm
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 02b3327bee..d615e46862 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -390,9 +390,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)
@@ -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();