Add comments

This commit is contained in:
Jack Grigg
2017-06-06 17:44:17 +12:00
parent 50fa079748
commit c032f1b687
2 changed files with 29 additions and 0 deletions

View File

@@ -164,7 +164,13 @@ bool static IsLowDERSignature(const valtype &vchSig, ScriptError* serror) {
if (!IsValidSignatureEncoding(vchSig)) {
return set_error(serror, SCRIPT_ERR_SIG_DER);
}
// https://bitcoin.stackexchange.com/a/12556:
// Also note that inside transaction signatures, an extra hashtype byte
// follows the actual signature data.
std::vector<unsigned char> vchSigCopy(vchSig.begin(), vchSig.begin() + vchSig.size() - 1);
// If the S value is above the order of the curve divided by two, its
// complement modulo the order could have been used instead, which is
// one byte shorter when encoded correctly.
return CPubKey::CheckLowS(vchSigCopy);
}