| 1242 | } |
| 1243 | |
| 1244 | bool TransactionSignatureChecker::CheckSig(const vector<unsigned char>& vchSigIn, const vector<unsigned char>& vchPubKey, |
| 1245 | const CScript& scriptCode, unsigned int flags) const |
| 1246 | { |
| 1247 | CPubKey pubkey(vchPubKey); |
| 1248 | if (!pubkey.IsValid()) |
| 1249 | return false; |
| 1250 | |
| 1251 | // Hash type is one byte tacked on to the end of the signature |
| 1252 | vector<unsigned char> vchSig(vchSigIn); |
| 1253 | if (vchSig.empty()) |
| 1254 | return false; |
| 1255 | uint32_t nHashType = GetHashType(vchSig); |
| 1256 | vchSig.pop_back(); |
| 1257 | |
| 1258 | uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, flags); |
| 1259 | |
| 1260 | if (!VerifySignature(vchSig, pubkey, sighash)) |
| 1261 | return false; |
| 1262 | |
| 1263 | return true; |
| 1264 | } |
| 1265 | |
| 1266 | bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) const |
| 1267 | { |
no test coverage detected