Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 1,459 Lines • ▼ Show 20 Lines | uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | ||||
CHashWriter ss(SER_GETHASH, 0); | CHashWriter ss(SER_GETHASH, 0); | ||||
ss << txTmp << sigHashType; | ss << txTmp << sigHashType; | ||||
return ss.GetHash(); | return ss.GetHash(); | ||||
} | } | ||||
bool BaseSignatureChecker::VerifySignature(const std::vector<uint8_t> &vchSig, | bool BaseSignatureChecker::VerifySignature(const std::vector<uint8_t> &vchSig, | ||||
const CPubKey &pubkey, | const CPubKey &pubkey, | ||||
const uint256 &sighash) const { | const uint256 &sighash) const { | ||||
return pubkey.Verify(sighash, vchSig); | return pubkey.VerifyECDSA(sighash, vchSig); | ||||
} | } | ||||
bool TransactionSignatureChecker::CheckSig( | bool TransactionSignatureChecker::CheckSig( | ||||
const std::vector<uint8_t> &vchSigIn, const std::vector<uint8_t> &vchPubKey, | const std::vector<uint8_t> &vchSigIn, const std::vector<uint8_t> &vchPubKey, | ||||
const CScript &scriptCode, uint32_t flags) const { | const CScript &scriptCode, uint32_t flags) const { | ||||
CPubKey pubkey(vchPubKey); | CPubKey pubkey(vchPubKey); | ||||
if (!pubkey.IsValid()) { | if (!pubkey.IsValid()) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |