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