Changeset View
Changeset View
Standalone View
Standalone View
src/coins.h
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Check if we have the given utxo already loaded in this cache. | * Check if we have the given utxo already loaded in this cache. | ||||
* The semantics are the same as HaveCoin(), but no calls to the backing | * The semantics are the same as HaveCoin(), but no calls to the backing | ||||
* CCoinsView are made. | * CCoinsView are made. | ||||
*/ | */ | ||||
bool HaveCoinInCache(const COutPoint &outpoint) const; | bool HaveCoinInCache(const COutPoint &outpoint) const; | ||||
/** | /** | ||||
* Return a reference to a Coin in the cache, or a pruned one if not found. | * Return a reference to Coin in the cache, or a pruned one if not found. | ||||
* This is more efficient than GetCoin. Modifications to other cache entries | * This is more efficient than GetCoin. | ||||
* are allowed while accessing the returned pointer. | * | ||||
* Generally, do not hold the reference returned for more than a short | |||||
* scope. While the current implementation allows for modifications to the | |||||
* contents of the cache while holding the reference, this behavior should | |||||
* not be relied on! To be safe, best to not hold the returned reference | |||||
* through any other calls to this cache. | |||||
*/ | */ | ||||
const Coin &AccessCoin(const COutPoint &output) const; | const Coin &AccessCoin(const COutPoint &output) const; | ||||
/** | /** | ||||
* Add a coin. Set potential_overwrite to true if a non-pruned version may | * Add a coin. Set potential_overwrite to true if a non-pruned version may | ||||
* already exist. | * already exist. | ||||
*/ | */ | ||||
void AddCoin(const COutPoint &outpoint, Coin coin, | void AddCoin(const COutPoint &outpoint, Coin coin, | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |