Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch UTXO set read errors and shutdown #5619

Merged
merged 1 commit into from
Jan 12, 2015
Merged

Conversation

sipa
Copy link
Member

@sipa sipa commented Jan 8, 2015

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.

@laanwj laanwj added this to the 0.10.0 milestone Jan 8, 2015
@laanwj laanwj added the Bug label Jan 8, 2015
@sipa sipa force-pushed the catcherror branch 2 times, most recently from 58f3272 to 62bc982 Compare January 8, 2015 14:19
try {
return CCoinsViewBacked::GetCoins(txid, coins);
} catch(const std::runtime_error& e) {
uiInterface.ThreadSafeMessageBox(strprintf("Error reading from database (%s), shutting down.", e.what()), "", CClientUIInterface::MSG_ERROR);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message also needs a _() for translation.

@laanwj
Copy link
Member

laanwj commented Jan 8, 2015

utACK. Should fix #5588 and #5462.

@jgarzik
Copy link
Contributor

jgarzik commented Jan 8, 2015

tested ACK

@petertodd
Copy link
Contributor

utACK

@laanwj laanwj merged commit 13cdce4 into bitcoin:master Jan 12, 2015
laanwj added a commit that referenced this pull request Jan 12, 2015
13cdce4 Catch UTXO set read errors and shutdown (Pieter Wuille)
sipa added a commit that referenced this pull request Jan 12, 2015
@gmaxwell
Copy link
Contributor

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

@ghost ghost mentioned this pull request May 6, 2016
reddink pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request May 27, 2020
Github-Pull: bitcoin#5619
Rebased-From: 13cdce4
(cherry picked from commit 4e7c219)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants