AddCoins

Utility function to add all of a transaction's outputs to a cache. When check is false, this assumes that overwrites are only possible for coinbase transactions. When check is true, the underlying view may be queried to determine whether an addition is an overwrite.

Synopsis

Declared in <coins.h>

void
AddCoins(
    CCoinsViewCache& cache,
    CTransaction const& tx,
    int nHeight,
    bool check = false);

Parameters

NameDescription
cacheCache to add the transaction's outputs to.
txTransaction whose outputs are added.
nHeightHeight of the block that includes the transaction.
checkWhen true, query the underlying view to detect overwrites.