Skip to content

Commit 85c9ea4

Browse files
authored
Throw a bit more descriptive error message on UpgradeDB failure on pruned nodes (#2962)
1 parent 2c5e2bc commit 85c9ea4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/llmq/quorums_blockprocessor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ void CQuorumBlockProcessor::UpgradeDB()
271271
if (chainActive.Height() >= Params().GetConsensus().DIP0003EnforcementHeight) {
272272
auto pindex = chainActive[Params().GetConsensus().DIP0003EnforcementHeight];
273273
while (pindex) {
274+
if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
275+
// Too late, we already pruned blocks we needed to reprocess commitments
276+
throw std::runtime_error(std::string(__func__) + ": Quorum Commitments DB upgrade failed, you need to re-download the blockchain");
277+
}
274278
CBlock block;
275279
bool r = ReadBlockFromDisk(block, pindex, Params().GetConsensus());
276280
assert(r);

0 commit comments

Comments
 (0)