mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Do not invoke DoS for non-canonical sigs
This commit is contained in:
parent
72782f3b92
commit
97e7901a3a
10
src/main.cpp
10
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user