aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-05-02 12:12:55 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-05-02 12:12:55 +0200
commit29c9bdcc141afb14fc9e1213f49de4fcded6ce0c (patch)
treecc332a0390a37bbbc01fbaf098bde75eab166de6 /src/index
parent57c57df86f14874cfc4b280e04a7f44b19839c26 (diff)
downloadbitcoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.tar.xz
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 2a661f0330..ad1682c9cf 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());