aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-05-07 13:39:13 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-05-07 13:39:19 +0200
commitbd83704ec6fa9a6564cd0f489efa65c1ecb095c2 (patch)
treebb395f2c1f8af8899a872b24e8e15f6f51edc745 /src/index
parent6a01a50f4906a00ce55b4e542fe850d84de54d73 (diff)
parent20ce5af4c647d9ebd97b40683bd0747383c9dc20 (diff)
downloadbitcoin-bd83704ec6fa9a6564cd0f489efa65c1ecb095c2.tar.xz
Merge #13149: Handle unsuccessful fseek(...):s
20ce5af Print a log message if we fail to shrink the debug log file (practicalswift) 29c9bdc Handle unsuccessful fseek(...):s (practicalswift) Pull request description: Handle unsuccessful `fseek(...)`:s. **Note to reviewers:** What is the most appropriate course of actions for each of these unsuccessful `fseek(...)`:s? Tree-SHA512: 5b3d82dbdd15d434d3f08dcb4df62888da4df8541d2586f56a4e529083005f6782c39e10645acd1ec403da83061bbfd8dbf2dddc66e09268d410ad0918c61876
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 0bb553ee6a..5b6e0f9980 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());