diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2012-05-22 22:55:49 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-05-22 22:55:49 +0000 |
commit | 3b36da6d277c6f5ad671343e724e0336ce55c893 (patch) | |
tree | 1e3761e0276bc4ea9b571868f61c4ae7fce7c3e6 /src/main.h | |
parent | 087fc28f7d4e82a0b79dabbaa19358e48d3084fe (diff) | |
parent | a2de1ea2d5776289c247bbc18c1ed13e16a4169f (diff) | |
download | bitcoin-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/main.h')
-rw-r--r-- | src/main.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main.h b/src/main.h index f2350cfc7b..21bb4c8a0b 100644 --- a/src/main.h +++ b/src/main.h @@ -607,7 +607,13 @@ public: // Read transaction if (fseek(filein, pos.nTxPos, SEEK_SET) != 0) return error("CTransaction::ReadFromDisk() : fseek failed"); - filein >> *this; + + try { + filein >> *this; + } + catch (std::exception &e) { + return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + } // Return file pointer if (pfileRet) @@ -1003,7 +1009,12 @@ public: filein.nType |= SER_BLOCKHEADERONLY; // Read block - filein >> *this; + try { + filein >> *this; + } + catch (std::exception &e) { + return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + } // Check the header if (!CheckProofOfWork(GetHash(), nBits)) |