|
|
@@ -99,7 +99,7 @@ bool static IsCompressedPubKey(const valtype &vchPubKey) { |
|
|
|
* Where R and S are not negative (their first byte has its highest bit not set), and not |
|
|
|
* excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, |
|
|
|
* in which case a single 0 byte is necessary and even required). |
|
|
|
* |
|
|
|
* |
|
|
|
* See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 |
|
|
|
* |
|
|
|
* This function is consensus-critical since BIP66. |
|
|
@@ -139,7 +139,7 @@ bool static IsValidSignatureEncoding(const std::vector<unsigned char> &sig) { |
|
|
|
// Verify that the length of the signature matches the sum of the length |
|
|
|
// of the elements. |
|
|
|
if ((size_t)(lenR + lenS + 7) != sig.size()) return false; |
|
|
|
|
|
|
|
|
|
|
|
// Check whether the R element is an integer. |
|
|
|
if (sig[2] != 0x02) return false; |
|
|
|
|
|
|
@@ -869,7 +869,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& |
|
|
|
popstack(stack); |
|
|
|
stack.push_back(vchHash); |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case OP_CODESEPARATOR: |
|
|
|
{ |
|
|
@@ -1527,7 +1527,8 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C |
|
|
|
// We can't check for correct unexpected witness data if P2SH was off, so require |
|
|
|
// that WITNESS implies P2SH. Otherwise, going from WITNESS->P2SH+WITNESS would be |
|
|
|
// possible, which is not a softfork. |
|
|
|
assert((flags & SCRIPT_VERIFY_P2SH) != 0); |
|
|
|
|
|
|
|
// assert((flags & SCRIPT_VERIFY_P2SH) != 0); |
|
|
|
if (!hadWitness && !witness->IsNull()) { |
|
|
|
return set_error(serror, SCRIPT_ERR_WITNESS_UNEXPECTED); |
|
|
|
} |
|
|
@@ -1559,7 +1560,7 @@ size_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, |
|
|
|
if ((flags & SCRIPT_VERIFY_WITNESS) == 0) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
assert((flags & SCRIPT_VERIFY_P2SH) != 0); |
|
|
|
// assert((flags & SCRIPT_VERIFY_P2SH) != 0); |
|
|
|
|
|
|
|
int witnessversion; |
|
|
|
std::vector<unsigned char> witnessprogram; |