Handle unsuccessful fseek(...):s

This commit is contained in:
practicalswift
2018-05-02 12:12:55 +02:00
parent 57c57df86f
commit 29c9bdcc14
3 changed files with 10 additions and 3 deletions

View File

@@ -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());