Skip to content

Commit 6a7f877

Browse files
committed
Ban all peers for all block script failures
This eliminates a discrepancy between block validation with multiple script check threads, versus a single script check thread.
1 parent 7b99910 commit 6a7f877

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/validation.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,9 +1998,13 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
19981998
{
19991999
std::vector<CScriptCheck> vChecks;
20002000
bool fCacheResults = fJustCheck; /* Don't cache results if we're actually connecting blocks (still consult the cache, though) */
2001-
if (!CheckInputs(tx, state, view, fScriptChecks, flags, fCacheResults, fCacheResults, txdata[i], nScriptCheckThreads ? &vChecks : nullptr))
2001+
if (!CheckInputs(tx, state, view, fScriptChecks, flags, fCacheResults, fCacheResults, txdata[i], nScriptCheckThreads ? &vChecks : nullptr)) {
2002+
// With parallel script checks, we always set DoS to 100; do
2003+
// that here as well for simplicity (for now).
2004+
state.DoS(100, false, state.GetRejectCode(), state.GetRejectReason(), state.CorruptionPossible(), state.GetDebugMessage());
20022005
return error("ConnectBlock(): CheckInputs on %s failed with %s",
20032006
tx.GetHash().ToString(), FormatStateMessage(state));
2007+
}
20042008
control.Add(vChecks);
20052009
}
20062010

0 commit comments

Comments
 (0)