Commit 75f08fc5 authored by Tom Zander's avatar Tom Zander

Be more careful when deciding to reorg

When reorgs greater than 6 are detected we refrain from taking
action (rolling back the chain) and wait for either user interaction
or till the chain extends the chain-tip again.
parent 7fc406a7
......@@ -289,10 +289,14 @@ void ValidationEnginePrivate::blockHeaderValidated(std::shared_ptr<BlockValidati
if (currentHeaderTip && !Blocks::DB::instance()->headerChain().Contains(currentHeaderTip)) { // re-org happened in headers.
logInfo(Log::BlockValidation) << "Header-reorg detected. Old-tip" << *currentHeaderTip->phashBlock << "@" << currentHeaderTip->nHeight;
prepareChain();
lastFullBlockScheduled = -1;
findMoreJobs();
return;
if (currentHeaderTip->nHeight - Blocks::DB::instance()->headerChain().Height() > 6) {
logCritical(Log::BlockValidation) << "Reorg larger than 6 blocks detected, this needs manual intervention.";
} else {
prepareChain();
lastFullBlockScheduled = -1;
findMoreJobs();
return;
}
}
const int diff = index->nHeight - blockchain->Height();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment