Catch UTXO set read errors and shutdown #5619

pull sipa wants to merge 1 commits into bitcoin:master from sipa:catcherror changing 1 files +26 −1
  1. sipa commented at 1:40 PM on January 8, 2015: member

    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.

  2. laanwj added this to the milestone 0.10.0 on Jan 8, 2015
  3. laanwj added the label Bug on Jan 8, 2015
  4. sipa force-pushed on Jan 8, 2015
  5. sipa force-pushed on Jan 8, 2015
  6. in src/init.cpp:None in 62bc98254c outdated
     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);
    


    laanwj commented at 2:48 PM on January 8, 2015:

    You can leave out the detailed error message in the UI. Just log it to debug.log for troubleshooting.


    laanwj commented at 2:49 PM on January 8, 2015:

    Message also needs a _() for translation.

  7. sipa force-pushed on Jan 8, 2015
  8. Catch UTXO set read errors and shutdown 13cdce4336
  9. sipa force-pushed on Jan 8, 2015
  10. laanwj commented at 2:55 PM on January 8, 2015: member

    utACK. Should fix #5588 and #5462.

  11. jgarzik commented at 3:06 PM on January 8, 2015: contributor

    tested ACK

  12. petertodd commented at 6:41 AM on January 9, 2015: contributor

    utACK

  13. laanwj cross-referenced this on Jan 9, 2015 from issue Assert inside leveldbwrapper to avoid continuing after failure. by gmaxwell
  14. laanwj merged this on Jan 12, 2015
  15. laanwj closed this on Jan 12, 2015

  16. laanwj referenced this in commit 868da0f40a on Jan 12, 2015
  17. laanwj cross-referenced this on Jan 12, 2015 from issue Node continues running after LevelDB throws an error by gmaxwell
  18. sipa referenced this in commit 4e7c219122 on Jan 12, 2015
  19. gmaxwell commented at 4:14 PM on January 12, 2015: contributor

    After the fact ninja ACK. (seems to successfully shut down on my faulty test host)

  20. unknown cross-referenced this on May 6, 2016 from issue CCoinsViewErrorCatcher raison-d-etre by ghost
  21. reddink referenced this in commit 2d5bac5266 on May 27, 2020
  22. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:55 UTC