Bitcoin ABC 0.32.4
P2P Digital Currency
Public Member Functions | Private Types | Private Attributes | List of all members
SignatureCache Class Reference

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>

Collaboration diagram for SignatureCache:
[legend]

Public Member Functions

 SignatureCache (size_t max_size_bytes)
 
 SignatureCache (const SignatureCache &)=delete
 
SignatureCacheoperator= (const SignatureCache &)=delete
 
void ComputeEntry (uint256 &entry, const uint256 &hash, const std::vector< uint8_t > &vchSig, const CPubKey &pubkey) const
 
bool Get (const uint256 &entry, const bool erase)
 
void Set (const uint256 &entry)
 

Private Types

typedef CuckooCache::cache< CuckooCache::KeyOnly< uint256 >, SignatureCacheHashermap_type
 

Private Attributes

CSHA256 m_salted_hasher
 Entries are SHA256(nonce || signature hash || public key || signature): More...
 
map_type setValid
 
std::shared_mutex cs_sigcache
 

Detailed Description

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 33 of file sigcache.h.

Member Typedef Documentation

◆ map_type

Definition at line 39 of file sigcache.h.

Constructor & Destructor Documentation

◆ SignatureCache() [1/2]

SignatureCache::SignatureCache ( size_t  max_size_bytes)

Definition at line 20 of file sigcache.cpp.

Here is the call graph for this function:

◆ SignatureCache() [2/2]

SignatureCache::SignatureCache ( const SignatureCache )
delete

Member Function Documentation

◆ ComputeEntry()

void SignatureCache::ComputeEntry ( uint256 entry,
const uint256 hash,
const std::vector< uint8_t > &  vchSig,
const CPubKey pubkey 
) const

Definition at line 35 of file sigcache.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get()

bool SignatureCache::Get ( const uint256 entry,
const bool  erase 
)

Definition at line 45 of file sigcache.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

SignatureCache & SignatureCache::operator= ( const SignatureCache )
delete

◆ Set()

void SignatureCache::Set ( const uint256 entry)

Definition at line 50 of file sigcache.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cs_sigcache

std::shared_mutex SignatureCache::cs_sigcache
private

Definition at line 41 of file sigcache.h.

◆ m_salted_hasher

CSHA256 SignatureCache::m_salted_hasher
private

Entries are SHA256(nonce || signature hash || public key || signature):

Definition at line 36 of file sigcache.h.

◆ setValid

map_type SignatureCache::setValid
private

Definition at line 40 of file sigcache.h.


The documentation for this class was generated from the following files: