Bitcoin Core 28.99.0
P2P Digital Currency
|
Valid signature cache, to avoid doing expensive ECDSA signature checking twice for every transaction (once when accepted into memory pool, and again when accepted into the block chain) More...
#include <sigcache.h>
Public Member Functions | |
SignatureCache (size_t max_size_bytes) | |
SignatureCache (const SignatureCache &)=delete | |
SignatureCache & | operator= (const SignatureCache &)=delete |
void | ComputeEntryECDSA (uint256 &entry, const uint256 &hash, const std::vector< unsigned char > &vchSig, const CPubKey &pubkey) const |
void | ComputeEntrySchnorr (uint256 &entry, const uint256 &hash, Span< const unsigned char > sig, const XOnlyPubKey &pubkey) const |
bool | Get (const uint256 &entry, const bool erase) |
void | Set (const uint256 &entry) |
Private Types | |
typedef CuckooCache::cache< uint256, SignatureCacheHasher > | map_type |
Private Attributes | |
CSHA256 | m_salted_hasher_ecdsa |
Entries are SHA256(nonce || 'E' or 'S' || 31 zero bytes || signature hash || public key || signature): More... | |
CSHA256 | m_salted_hasher_schnorr |
map_type | setValid |
std::shared_mutex | cs_sigcache |
Valid signature cache, to avoid doing expensive ECDSA signature checking twice for every transaction (once when accepted into memory pool, and again when accepted into the block chain)
Definition at line 38 of file sigcache.h.
|
private |
Definition at line 44 of file sigcache.h.
SignatureCache::SignatureCache | ( | size_t | max_size_bytes | ) |
|
delete |
void SignatureCache::ComputeEntryECDSA | ( | uint256 & | entry, |
const uint256 & | hash, | ||
const std::vector< unsigned char > & | vchSig, | ||
const CPubKey & | pubkey | ||
) | const |
Definition at line 39 of file sigcache.cpp.
void SignatureCache::ComputeEntrySchnorr | ( | uint256 & | entry, |
const uint256 & | hash, | ||
Span< const unsigned char > | sig, | ||
const XOnlyPubKey & | pubkey | ||
) | const |
Definition at line 45 of file sigcache.cpp.
bool SignatureCache::Get | ( | const uint256 & | entry, |
const bool | erase | ||
) |
Definition at line 51 of file sigcache.cpp.
|
delete |
void SignatureCache::Set | ( | const uint256 & | entry | ) |
Definition at line 57 of file sigcache.cpp.
|
private |
Definition at line 46 of file sigcache.h.
|
private |
Entries are SHA256(nonce || 'E' or 'S' || 31 zero bytes || signature hash || public key || signature):
Definition at line 42 of file sigcache.h.
|
private |
Definition at line 43 of file sigcache.h.
|
private |
Definition at line 45 of file sigcache.h.