| 1351 | |
| 1352 | template <class T> |
| 1353 | bool GenericTransactionSignatureChecker<T>::CheckSig(const std::vector<unsigned char>& vchSigIn, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion, bool no_forkid) const |
| 1354 | { |
| 1355 | CPubKey pubkey(vchPubKey); |
| 1356 | if (!pubkey.IsValid()) |
| 1357 | return false; |
| 1358 | |
| 1359 | // Hash type is one byte tacked on to the end of the signature |
| 1360 | std::vector<unsigned char> vchSig(vchSigIn); |
| 1361 | if (vchSig.empty()) |
| 1362 | return false; |
| 1363 | int nHashType = GetHashType(vchSig); |
| 1364 | vchSig.pop_back(); |
| 1365 | |
| 1366 | uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion, no_forkid, this->txdata); |
| 1367 | |
| 1368 | if (!VerifySignature(vchSig, pubkey, sighash)) |
| 1369 | return false; |
| 1370 | |
| 1371 | return true; |
| 1372 | } |
| 1373 | |
| 1374 | template <class T> |
| 1375 | bool GenericTransactionSignatureChecker<T>::CheckLockTime(const CScriptNum& nLockTime) const |
no test coverage detected