aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2019-04-16 12:38:14 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2019-05-02 11:00:19 -0400
commit6a7f8777a0b193fae4f976196f3464ffac01bf1b (patch)
tree67d033d1829c84e0c7a7cfe13b8f838e48f0c1dc
parent7b999103e21509e1c2dec10f68e48744ffe90f55 (diff)
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.
-rw-r--r--src/validation.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 37082d3b06..0951b3cf97 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1998,9 +1998,13 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
{
std::vector<CScriptCheck> vChecks;
bool fCacheResults = fJustCheck; /* Don't cache results if we're actually connecting blocks (still consult the cache, though) */
- if (!CheckInputs(tx, state, view, fScriptChecks, flags, fCacheResults, fCacheResults, txdata[i], nScriptCheckThreads ? &vChecks : nullptr))
+ if (!CheckInputs(tx, state, view, fScriptChecks, flags, fCacheResults, fCacheResults, txdata[i], nScriptCheckThreads ? &vChecks : nullptr)) {
+ // With parallel script checks, we always set DoS to 100; do
+ // that here as well for simplicity (for now).
+ state.DoS(100, false, state.GetRejectCode(), state.GetRejectReason(), state.CorruptionPossible(), state.GetDebugMessage());
return error("ConnectBlock(): CheckInputs on %s failed with %s",
tx.GetHash().ToString(), FormatStateMessage(state));
+ }
control.Add(vChecks);
}