Skip to content

Commit 6e77920

Browse files
committed
Merge pull request #3453
96e5f61 extend std::exception logging in txdb.cpp (Philip Kaufmann)
2 parents 086d7ec + 96e5f61 commit 6e77920

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/txdb.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ void static BatchWriteHashBestChain(CLevelDBBatch &batch, const uint256 &hash) {
2626
CCoinsViewDB::CCoinsViewDB(size_t nCacheSize, bool fMemory, bool fWipe) : db(GetDataDir() / "chainstate", nCacheSize, fMemory, fWipe) {
2727
}
2828

29-
bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) {
30-
return db.Read(make_pair('c', txid), coins);
29+
bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) {
30+
return db.Read(make_pair('c', txid), coins);
3131
}
3232

3333
bool CCoinsViewDB::SetCoins(const uint256 &txid, const CCoins &coins) {
@@ -37,7 +37,7 @@ bool CCoinsViewDB::SetCoins(const uint256 &txid, const CCoins &coins) {
3737
}
3838

3939
bool CCoinsViewDB::HaveCoins(const uint256 &txid) {
40-
return db.Exists(make_pair('c', txid));
40+
return db.Exists(make_pair('c', txid));
4141
}
4242

4343
uint256 CCoinsViewDB::GetBestBlock() {
@@ -131,7 +131,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) {
131131
ssKey >> txhash;
132132
ss << txhash;
133133
ss << VARINT(coins.nVersion);
134-
ss << (coins.fCoinBase ? 'c' : 'n');
134+
ss << (coins.fCoinBase ? 'c' : 'n');
135135
ss << VARINT(coins.nHeight);
136136
stats.nTransactions++;
137137
for (unsigned int i=0; i<coins.vout.size(); i++) {
@@ -148,7 +148,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) {
148148
}
149149
pcursor->Next();
150150
} catch (std::exception &e) {
151-
return error("%s() : deserialize error", __PRETTY_FUNCTION__);
151+
return error("%s : Deserialize or I/O error - %s", __PRETTY_FUNCTION__, e.what());
152152
}
153153
}
154154
delete pcursor;
@@ -226,7 +226,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
226226
break; // if shutdown requested or finished loading block index
227227
}
228228
} catch (std::exception &e) {
229-
return error("%s() : deserialize error", __PRETTY_FUNCTION__);
229+
return error("%s : Deserialize or I/O error - %s", __PRETTY_FUNCTION__, e.what());
230230
}
231231
}
232232
delete pcursor;

0 commit comments

Comments
 (0)