validation: return VerifyDBResult::INTERRUPTED if verification was interrupted

This means that the -verifydb RPC will now return false if it
cannot finish due to the node being shutdown.
This commit is contained in:
Martin Zumsande
2023-02-16 16:54:26 -05:00
parent 6360b5302d
commit d6f781f1cf
3 changed files with 4 additions and 2 deletions

View File

@@ -4146,7 +4146,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
skipped_l3_checks = true;
}
}
if (ShutdownRequested()) return VerifyDBResult::SUCCESS;
if (ShutdownRequested()) return VerifyDBResult::INTERRUPTED;
}
if (pindexFailure) {
LogPrintf("Verification error: coin database inconsistencies found (last %i blocks, %i good transactions before that)\n", chainstate.m_chain.Height() - pindexFailure->nHeight + 1, nGoodTransactions);
@@ -4179,7 +4179,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
LogPrintf("Verification error: found unconnectable block at %d, hash=%s (%s)\n", pindex->nHeight, pindex->GetBlockHash().ToString(), state.ToString());
return VerifyDBResult::CORRUPTED_BLOCK_DB;
}
if (ShutdownRequested()) return VerifyDBResult::SUCCESS;
if (ShutdownRequested()) return VerifyDBResult::INTERRUPTED;
}
}