Bitcoin
Classes | Typedefs | Functions
coins.h File Reference
#include <primitives/transaction.h>
#include <compressor.h>
#include <core_memusage.h>
#include <crypto/siphash.h>
#include <memusage.h>
#include <serialize.h>
#include <uint256.h>
#include <assert.h>
#include <stdint.h>
#include <unordered_map>

Go to the source code of this file.

Classes

class  Coin
 
class  SaltedOutpointHasher
 
struct  CCoinsCacheEntry
 
class  CCoinsViewCursor
 
class  CCoinsView
 
class  CCoinsViewBacked
 
class  CCoinsViewCache
 

Typedefs

typedef std::unordered_map< COutPoint, CCoinsCacheEntry, SaltedOutpointHasherCCoinsMap
 

Functions

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

Typedef Documentation

◆ CCoinsMap

Function Documentation

◆ AccessByTxid()

const Coin& AccessByTxid ( const CCoinsViewCache cache,
const uint256 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.

◆ 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.