aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorJack Grigg <jack@z.cash>2017-06-06 17:44:17 +1200
committerJack Grigg <jack@z.cash>2017-07-17 11:55:05 -0500
commite181dbe7482424d2658df08e7a0c3cd832839edf (patch)
treea1d11ce3534df7213f170cc371da96d79a157e48 /src/script
parenta3603ac6f07966036e56554cd754a57791a3491a (diff)
downloadbitcoin-e181dbe7482424d2658df08e7a0c3cd832839edf.tar.xz
Add comments
Diffstat (limited to 'src/script')
-rw-r--r--src/script/interpreter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 8a121774a0..39e06f4a51 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -174,7 +174,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.
if (!CPubKey::CheckLowS(vchSigCopy)) {
return set_error(serror, SCRIPT_ERR_SIG_HIGH_S);
}