Changeset View
Changeset View
Standalone View
Standalone View
src/coins.h
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | public: | ||||
const CTxOut &GetOutputFor(const CTxIn &input) const; | const CTxOut &GetOutputFor(const CTxIn &input) const; | ||||
private: | private: | ||||
CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const; | CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const; | ||||
}; | }; | ||||
//! Utility function to add all of a transaction's outputs to a cache. | //! 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 | //! When check is false, this assumes that overwrites are only possible for | ||||
// coinbase transactions. | //! coinbase transactions. When check is true, the underlying view may be | ||||
// When check is true, the underlying view may be queried to determine whether | //! queried to determine whether an addition is an overwrite. | ||||
// an addition is an overwrite. | |||||
// TODO: pass in a boolean to limit these possible overwrites to known | // TODO: pass in a boolean to limit these possible overwrites to known | ||||
// (pre-BIP34) cases. | // (pre-BIP34) cases. | ||||
void AddCoins(CCoinsViewCache &cache, const CTransaction &tx, int nHeight, | void AddCoins(CCoinsViewCache &cache, const CTransaction &tx, int nHeight, | ||||
bool check = false); | bool check = false); | ||||
//! Utility function to find any unspent output with a given 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 | //! 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 | //! 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. | //! lookups to database, so it should be used with care. | ||||
const Coin &AccessByTxid(const CCoinsViewCache &cache, const TxId &txid); | const Coin &AccessByTxid(const CCoinsViewCache &cache, const TxId &txid); | ||||
#endif // BITCOIN_COINS_H | #endif // BITCOIN_COINS_H |