| 198 | } |
| 199 | |
| 200 | bool static IsDefinedHashtypeSignature(const valtype &vchSig) { |
| 201 | if (vchSig.size() == 0) { |
| 202 | return false; |
| 203 | } |
| 204 | unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); |
| 205 | if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) |
| 206 | return false; |
| 207 | |
| 208 | return true; |
| 209 | } |
| 210 | |
| 211 | bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, script_verify_flags flags, ScriptError* serror) { |
| 212 | // Empty signature. Not strictly DER encoded, but allowed to provide a |
no test coverage detected