MCPcopy Create free account
hub / github.com/LUX-Core/lux / CheckSig

Method CheckSig

src/script/interpreter.cpp:1298–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1296}
1297
1298bool TransactionSignatureChecker::CheckSig(const vector<unsigned char>& vchSigIn, const vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion, uint32_t flags) const
1299{
1300 CPubKey pubkey(vchPubKey);
1301 if (!pubkey.IsValid())
1302 return false;
1303
1304 // Hash type is one byte tacked on to the end of the signature
1305 vector<unsigned char> vchSig(vchSigIn);
1306 if (vchSig.empty())
1307 return false;
1308 int nHashType = vchSig.back();
1309 vchSig.pop_back();
1310
1311 uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion, this->txdata);
1312
1313 if (!VerifySignature(vchSig, pubkey, sighash, flags))
1314 return false;
1315
1316 return true;
1317}
1318
1319bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) const
1320{

Callers 1

EvalScriptFunction · 0.45

Calls 5

backMethod · 0.80
pop_backMethod · 0.80
SignatureHashFunction · 0.70
IsValidMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected