aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorpracticalswift <[email protected]>2018-05-02 12:12:55 +0200
committerpracticalswift <[email protected]>2018-05-02 12:12:55 +0200
commit29c9bdcc141afb14fc9e1213f49de4fcded6ce0c (patch)
treecc332a0390a37bbbc01fbaf098bde75eab166de6 /src/index
parentMerge #13141: [doc] qt: fixes broken link on readme (diff)
downloaddiscoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.tar.xz
discoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.zip
Handle unsuccessful fseek(...):s
Diffstat (limited to 'src/index')
-rw-r--r--src/index/txindex.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index 2a661f033..ad1682c9c 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -268,7 +268,9 @@ bool TxIndex::FindTx(const uint256& tx_hash, uint256& block_hash, CTransactionRe
CBlockHeader header;
try {
file >> header;
- fseek(file.Get(), postx.nTxOffset, SEEK_CUR);
+ if (fseek(file.Get(), postx.nTxOffset, SEEK_CUR)) {
+ return error("%s: fseek(...) failed", __func__);
+ }
file >> tx;
} catch (const std::exception& e) {
return error("%s: Deserialize or I/O error - %s", __func__, e.what());