Bitcoin ABC  0.26.3
P2P Digital Currency
Functions | Variables
coins.cpp File Reference
#include <coins.h>
#include <consensus/consensus.h>
#include <logging.h>
#include <random.h>
#include <util/trace.h>
#include <version.h>
Include dependency graph for coins.cpp:

Go to the source code of this file.

Functions

void AddCoins (CCoinsViewCache &cache, const CTransaction &tx, int nHeight, bool check_for_overwrite)
 Utility function to add all of a transaction's outputs to a cache. More...
 
const CoinAccessByTxid (const CCoinsViewCache &view, const TxId &txid)
 Utility function to find any unspent output with a given txid. More...
 

Variables

static const Coin coinEmpty
 
static const size_t MAX_OUTPUTS_PER_TX
 

Function Documentation

◆ AccessByTxid()

const Coin& AccessByTxid ( const CCoinsViewCache cache,
const TxId txid 
)

Utility function to find any unspent output with a given txid.

This function can be quite expensive because in the event of a transaction which is not found in the cache, it can cause up to MAX_OUTPUTS_PER_BLOCK lookups to database, so it should be used with care.

Definition at line 331 of file coins.cpp.

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

◆ AddCoins()

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

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.

Definition at line 152 of file coins.cpp.

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

Variable Documentation

◆ coinEmpty

const Coin coinEmpty
static

Definition at line 190 of file coins.cpp.

◆ MAX_OUTPUTS_PER_TX

const size_t MAX_OUTPUTS_PER_TX
static
Initial value:
=
An output of a transaction.
Definition: transaction.h:128
static const uint64_t MAX_TX_SIZE
The maximum allowed size for a transaction, in bytes.
Definition: consensus.h:14
size_t GetSerializeSize(const T &t, int nVersion=0)
Definition: serialize.h:1258
static const int PROTOCOL_VERSION
network protocol versioning
Definition: version.h:11

Definition at line 328 of file coins.cpp.