From 29c9bdcc141afb14fc9e1213f49de4fcded6ce0c Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 2 May 2018 12:12:55 +0200 Subject: Handle unsuccessful fseek(...):s --- src/index/txindex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/index') 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()); -- cgit v1.2.3