MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / CheckSig

Method CheckSig

src/script/interpreter.cpp:1353–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1351
1352template <class T>
1353bool 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
1374template <class T>
1375bool GenericTransactionSignatureChecker<T>::CheckLockTime(const CScriptNum& nLockTime) const

Callers 1

EvalScriptFunction · 0.45

Calls 5

GetHashTypeFunction · 0.85
SignatureHashFunction · 0.70
IsValidMethod · 0.45
emptyMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected