Skip to content

Commit

Permalink
Merge pull request bitcoin#2540 from sipa/nodosnocan
Browse files Browse the repository at this point in the history
Do not invoke DoS for non-canonical sigs
  • Loading branch information
gavinandresen committed Apr 19, 2013
2 parents 72782f3 + 97e7901 commit ce8de31
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit ce8de31

Please sign in to comment.