Hashes a transaction outpoint (COutPoint) with a per‐instance random salt.

Synopsis

Declared in <util/hasher.h>

class SaltedOutpointHasher;

Member Functions

Name

Description

SaltedOutpointHasher [constructor]

Construct the hasher with a fresh random salt.

operator()

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.

Created with MrDocs