diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-04-18 22:17:05 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2013-04-18 22:49:23 +0200 |
commit | 97e7901a3a7403cd5a5a027ad83e9674e3b950be (patch) | |
tree | b1238e00fc1a5b7429aa7658171a78522bdc198e /src/main.cpp | |
parent | 72782f3b92ca7dbfd44210e6a2a93d9860fcd405 (diff) |
Do not invoke DoS for non-canonical sigs
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 6f3b5da961..aace382d8b 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); + } } } } |