mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
validation: Stricter assumeutxo error handling in InvalidateCoinsDBOnDisk
Currently InvalidateCoinsDBOnDisk is calling AbortNode without an error to the caller if it fails. Change it to return just return util::Result, and update the caller to handle the error itself. This causes the secondary error to be shown below the main error instead of the other way around.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <util/check.h>
|
||||
#include <util/fs.h>
|
||||
#include <util/hasher.h>
|
||||
#include <util/result.h>
|
||||
#include <util/translation.h>
|
||||
#include <versionbits.h>
|
||||
|
||||
@@ -810,7 +811,7 @@ private:
|
||||
* In case of an invalid snapshot, rename the coins leveldb directory so
|
||||
* that it can be examined for issue diagnosis.
|
||||
*/
|
||||
void InvalidateCoinsDBOnDisk() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
[[nodiscard]] util::Result<void> InvalidateCoinsDBOnDisk() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
|
||||
friend ChainstateManager;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user