From 85c9ea400b402dfcfa6b8b6141ace7c1dbe74f77 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 8 Jun 2019 14:16:41 +0300 Subject: [PATCH] Throw a bit more descriptive error message on UpgradeDB failure on pruned nodes (#2962) --- src/llmq/quorums_blockprocessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/llmq/quorums_blockprocessor.cpp b/src/llmq/quorums_blockprocessor.cpp index 302600fe6..e7ddde295 100644 --- a/src/llmq/quorums_blockprocessor.cpp +++ b/src/llmq/quorums_blockprocessor.cpp @@ -271,6 +271,10 @@ void CQuorumBlockProcessor::UpgradeDB() if (chainActive.Height() >= Params().GetConsensus().DIP0003EnforcementHeight) { auto pindex = chainActive[Params().GetConsensus().DIP0003EnforcementHeight]; while (pindex) { + if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) { + // Too late, we already pruned blocks we needed to reprocess commitments + throw std::runtime_error(std::string(__func__) + ": Quorum Commitments DB upgrade failed, you need to re-download the blockchain"); + } CBlock block; bool r = ReadBlockFromDisk(block, pindex, Params().GetConsensus()); assert(r);