aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-04-19 10:29:37 -0700
committerGavin Andresen <[email protected]>2013-04-19 10:29:37 -0700
commitce8de31fbfdc6b76985f1f7cb0ccd49eb196384e (patch)
treeb1238e00fc1a5b7429aa7658171a78522bdc198e /src/main.cpp
parentMerge pull request #2525 from laanwj/2013_04_metatypebool (diff)
parentDo not invoke DoS for non-canonical sigs (diff)
downloaddiscoin-ce8de31fbfdc6b76985f1f7cb0ccd49eb196384e.tar.xz
discoin-ce8de31fbfdc6b76985f1f7cb0ccd49eb196384e.zip
Merge pull request #2540 from sipa/nodosnocan
Do not invoke DoS for non-canonical sigs
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 6f3b5da96..aace382d8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1438,8 +1438,16 @@ bool CTransaction::CheckInputs(CValidationState &state, CCoinsViewCache &inputs,
if (pvChecks) {
pvChecks->push_back(CScriptCheck());
check.swap(pvChecks->back());
- } else if (!check())
+ } else if (!check()) {
+ if (flags & SCRIPT_VERIFY_STRICTENC) {
+ // For now, check whether the failure was caused by non-canonical
+ // encodings or not; if so, don't trigger DoS protection.
+ CScriptCheck check(coins, *this, i, flags & (~SCRIPT_VERIFY_STRICTENC), 0);
+ if (check())
+ return state.Invalid();
+ }
return state.DoS(100,false);
+ }
}
}
}