6#ifndef BITCOIN_SCRIPT_SIGCACHE_H
7#define BITCOIN_SCRIPT_SIGCACHE_H
18#include <shared_mutex>
58 bool Get(
const uint256& entry,
const bool erase);
70 CachingTransactionSignatureChecker(
const CTransaction* txToIn,
unsigned int nInIn,
const CAmount& amountIn,
bool storeIn,
SignatureCache& signature_cache,
PrecomputedTransactionData& txdataIn) :
TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn,
MissingDataBehavior::
ASSERT_FAIL),
store(storeIn),
m_signature_cache(signature_cache) {}
int64_t CAmount
Amount in satoshis (Can be negative)
An encapsulated public key.
A hasher class for SHA-256.
The basic transaction that is broadcasted on the network and contained in blocks.
CachingTransactionSignatureChecker(const CTransaction *txToIn, unsigned int nInIn, const CAmount &amountIn, bool storeIn, SignatureCache &signature_cache, PrecomputedTransactionData &txdataIn)
bool VerifySchnorrSignature(Span< const unsigned char > sig, const XOnlyPubKey &pubkey, const uint256 &sighash) const override
SignatureCache & m_signature_cache
bool VerifyECDSASignature(const std::vector< unsigned char > &vchSig, const CPubKey &vchPubKey, const uint256 &sighash) const override
Valid signature cache, to avoid doing expensive ECDSA signature checking twice for every transaction ...
SignatureCache(size_t max_size_bytes)
CSHA256 m_salted_hasher_schnorr
void ComputeEntrySchnorr(uint256 &entry, const uint256 &hash, Span< const unsigned char > sig, const XOnlyPubKey &pubkey) const
void ComputeEntryECDSA(uint256 &entry, const uint256 &hash, const std::vector< unsigned char > &vchSig, const CPubKey &pubkey) const
std::shared_mutex cs_sigcache
SignatureCache & operator=(const SignatureCache &)=delete
SignatureCache(const SignatureCache &)=delete
CSHA256 m_salted_hasher_ecdsa
Entries are SHA256(nonce || 'E' or 'S' || 31 zero bytes || signature hash || public key || signature)...
CuckooCache::cache< uint256, SignatureCacheHasher > map_type
bool Get(const uint256 &entry, const bool erase)
void Set(const uint256 &entry)
MissingDataBehavior
Enum to specify what *TransactionSignatureChecker's behavior should be when dealing with missing tran...
@ ASSERT_FAIL
Abort execution through assertion failure (for consensus code)
static constexpr size_t DEFAULT_SIGNATURE_CACHE_BYTES
static constexpr size_t DEFAULT_SCRIPT_EXECUTION_CACHE_BYTES
static constexpr size_t DEFAULT_VALIDATION_CACHE_BYTES