| 1700 | |
| 1701 | template <class T> |
| 1702 | bool GenericTransactionSignatureChecker<T>::CheckECDSASignature(const std::vector<unsigned char>& vchSigIn, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const |
| 1703 | { |
| 1704 | CPubKey pubkey(vchPubKey); |
| 1705 | if (!pubkey.IsValid()) |
| 1706 | return false; |
| 1707 | |
| 1708 | // Hash type is one byte tacked on to the end of the signature |
| 1709 | std::vector<unsigned char> vchSig(vchSigIn); |
| 1710 | if (vchSig.empty()) |
| 1711 | return false; |
| 1712 | int nHashType = vchSig.back(); |
| 1713 | vchSig.pop_back(); |
| 1714 | |
| 1715 | // Witness sighashes need the amount. |
| 1716 | if (sigversion == SigVersion::WITNESS_V0 && amount < 0) return HandleMissingData(m_mdb); |
| 1717 | |
| 1718 | uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion, this->txdata, &m_sighash_cache); |
| 1719 | |
| 1720 | if (!VerifyECDSASignature(vchSig, pubkey, sighash)) |
| 1721 | return false; |
| 1722 | |
| 1723 | return true; |
| 1724 | } |
| 1725 | |
| 1726 | template <class T> |
| 1727 | bool GenericTransactionSignatureChecker<T>::CheckSchnorrSignature(std::span<const unsigned char> sig, std::span<const unsigned char> pubkey_in, SigVersion sigversion, ScriptExecutionData& execdata, ScriptError* serror) const |
no test coverage detected