Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
| Show First 20 Lines • Show All 1,461 Lines • ▼ Show 20 Lines | uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | ||||
| 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 uint256 &sighash, | ||||
| uint32_t flags) const { | uint32_t flags) const { | ||||
| if ((flags & SCRIPT_ENABLE_SCHNORR) && (vchSig.size() == 64)) { | |||||
| return pubkey.VerifySchnorr(sighash, vchSig); | |||||
| } else { | |||||
| return pubkey.VerifyECDSA(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 187 Lines • Show Last 20 Lines | |||||