Author: Wladimir 2014-06-06 08:29:13
Published on: 2014-06-06T08:29:13+00:00
In an email exchange, Jannis Froese suggested that concerns about the current use of asserts would be resolved if the currently used asserts were changed to a nicer definition which is independent of NDEBUG, and a second class of debugging asserts would be introduced, which is exclusively for expensive, redundant checks and is disabled by NDEBUG. Moreover, it was mentioned that assertion errors that happen to people running Bitcoin Core are not caused by software bugs but database corruption errors (usually due to unclean shutdown). For example, in case missing/truncated block files or UTXO db consistency are detected, instead of raising an assertion error, proposing a -reindex would be more suitable. Rather than using assertions, a fatal error function is needed for those problems which are probably recoverable in a certain specific way. In principle, starting a reindex wouldn't even need to take down the entire process (though that's easier for implementation due to cleanup and assumptions made).
Updated on: 2023-06-08T23:34:57.476461+00:00