Bitcoin ABC 0.26.3
P2P Digital Currency
|
#include <hasher.h>
Public Member Functions | |
SaltedOutpointHasher (bool deterministic=false) | |
size_t | operator() (const COutPoint &outpoint) const noexcept |
Having the hash noexcept allows libstdc++'s unordered_map to recalculate the hash during rehash, so it does not have to cache the value. | |
Private Attributes | |
const uint64_t | k0 |
Salt. | |
const uint64_t | k1 |
Definition at line 13 of file hasher.cpp.
Having the hash noexcept allows libstdc++'s unordered_map to recalculate the hash during rehash, so it does not have to cache the value.
This reduces node's memory by sizeof(size_t). The required recalculation has a slight performance penalty (around 1.6%), but this is compensated by memory savings of about 9% which allow for a larger dbcache setting.
Definition at line 61 of file hasher.h.