diff options
| author | Suhas Daftuar <[email protected]> | 2019-04-16 12:38:14 -0400 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2019-05-02 11:00:19 -0400 |
| commit | 6a7f8777a0b193fae4f976196f3464ffac01bf1b (patch) | |
| tree | 67d033d1829c84e0c7a7cfe13b8f838e48f0c1dc /src/validation.cpp | |
| parent | Clean up banning levels (diff) | |
| download | discoin-6a7f8777a0b193fae4f976196f3464ffac01bf1b.tar.xz discoin-6a7f8777a0b193fae4f976196f3464ffac01bf1b.zip | |
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.
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 37082d3b0..0951b3cf9 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); } |