Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* This is a minimally invasive approach to shutdown on LevelDB read errors from | * This is a minimally invasive approach to shutdown on LevelDB read errors from | ||||
* the chainstate, while keeping user interface out of the common library, which | * the chainstate, while keeping user interface out of the common library, which | ||||
* is shared between bitcoind, and bitcoin-qt and non-server tools. | * is shared between bitcoind, and bitcoin-qt and non-server tools. | ||||
*/ | */ | ||||
class CCoinsViewErrorCatcher : public CCoinsViewBacked { | class CCoinsViewErrorCatcher : public CCoinsViewBacked { | ||||
public: | public: | ||||
CCoinsViewErrorCatcher(CCoinsView *view) : CCoinsViewBacked(view) {} | CCoinsViewErrorCatcher(CCoinsView *view) : CCoinsViewBacked(view) {} | ||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const { | bool GetCoin(const COutPoint &outpoint, Coin &coin) const override { | ||||
try { | try { | ||||
return CCoinsViewBacked::GetCoin(outpoint, coin); | return CCoinsViewBacked::GetCoin(outpoint, coin); | ||||
} catch (const std::runtime_error &e) { | } catch (const std::runtime_error &e) { | ||||
uiInterface.ThreadSafeMessageBox( | uiInterface.ThreadSafeMessageBox( | ||||
_("Error reading from database, shutting down."), "", | _("Error reading from database, shutting down."), "", | ||||
CClientUIInterface::MSG_ERROR); | CClientUIInterface::MSG_ERROR); | ||||
LogPrintf("Error reading from database: %s\n", e.what()); | LogPrintf("Error reading from database: %s\n", e.what()); | ||||
// Starting the shutdown sequence and returning false to the caller | // Starting the shutdown sequence and returning false to the caller | ||||
▲ Show 20 Lines • Show All 2,045 Lines • Show Last 20 Lines |