This is a minimally invasive patch to shutdown on LevelDB read errors from the chainstate. The block index does not need similar protection, as it's only read at startup.
Should apply cleanly to 0.10 as well.
This is a minimally invasive patch to shutdown on LevelDB read errors from the chainstate. The block index does not need similar protection, as it's only read at startup.
Should apply cleanly to 0.10 as well.
117 | + CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {} 118 | + bool GetCoins(const uint256 &txid, CCoins &coins) const { 119 | + try { 120 | + return CCoinsViewBacked::GetCoins(txid, coins); 121 | + } catch(const std::runtime_error& e) { 122 | + uiInterface.ThreadSafeMessageBox(strprintf("Error reading from database (%s), shutting down.", e.what()), "", CClientUIInterface::MSG_ERROR);
You can leave out the detailed error message in the UI. Just log it to debug.log for troubleshooting.
Message also needs a _() for translation.
tested ACK
utACK
After the fact ninja ACK. (seems to successfully shut down on my faulty test host)
Milestone
0.10.0