mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
validation: Change return value of VerifyDB to enum type
This does not change behavior. It is in preparation for special handling of the case where VerifyDB doesn't finish for various reasons, but doesn't fail.
This commit is contained in:
@@ -349,12 +349,17 @@ bool HasValidProofOfWork(const std::vector<CBlockHeader>& headers, const Consens
|
||||
/** Return the sum of the work on a given set of headers */
|
||||
arith_uint256 CalculateHeadersWork(const std::vector<CBlockHeader>& headers);
|
||||
|
||||
enum class VerifyDBResult {
|
||||
SUCCESS,
|
||||
CORRUPTED_BLOCK_DB,
|
||||
};
|
||||
|
||||
/** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */
|
||||
class CVerifyDB {
|
||||
public:
|
||||
CVerifyDB();
|
||||
~CVerifyDB();
|
||||
bool VerifyDB(
|
||||
[[nodiscard]] VerifyDBResult VerifyDB(
|
||||
Chainstate& chainstate,
|
||||
const Consensus::Params& consensus_params,
|
||||
CCoinsView& coinsview,
|
||||
|
||||
Reference in New Issue
Block a user