From c7a83e0197959f9bf1ea3da30874a703be5239cb Mon Sep 17 00:00:00 2001 From: Ahmed Hilali Date: Sun, 30 May 2021 16:50:35 +0800 Subject: [PATCH] Add sleep after failed validation (#457) --- src/validation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/validation.cpp b/src/validation.cpp index 7fcc1831ed..7179ff1221 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2182,6 +2182,9 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl // problems. return AbortNode(state, "Corrupt block found indicating potential hardware failure; shutting down"); } + + // Add sleep here to avoid hot looping over failed but not invalidated block. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); return error("%s: Consensus::CheckBlock: %s", __func__, FormatStateMessage(state)); }