Changeset View
Changeset View
Standalone View
Standalone View
src/coins.h
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | public: | ||||
* This *must* return size_t. With Boost 1.46 on 32-bit systems the | * This *must* return size_t. With Boost 1.46 on 32-bit systems the | ||||
* unordered_map will behave unpredictably if the custom hasher returns a | * unordered_map will behave unpredictably if the custom hasher returns a | ||||
* uint64_t, resulting in failures when syncing the chain (#4634). | * uint64_t, resulting in failures when syncing the chain (#4634). | ||||
* Note: This information above might be outdated as the unordered map | * Note: This information above might be outdated as the unordered map | ||||
* container type has meanwhile been switched to the C++ standard library | * container type has meanwhile been switched to the C++ standard library | ||||
* implementation. | * implementation. | ||||
*/ | */ | ||||
size_t operator()(const COutPoint &outpoint) const { | size_t operator()(const COutPoint &outpoint) const { | ||||
return SipHashUint256Extra(k0, k1, outpoint.hash, outpoint.n); | return SipHashUint256Extra(k0, k1, outpoint.unspentid, outpoint.n); | ||||
} | } | ||||
}; | }; | ||||
struct CCoinsCacheEntry { | struct CCoinsCacheEntry { | ||||
// The actual cached data. | // The actual cached data. | ||||
Coin coin; | Coin coin; | ||||
uint8_t flags; | uint8_t flags; | ||||
▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
//! 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. | ||||
// It assumes that overwrites are only possible for coinbase transactions. | // It assumes that overwrites are only possible for coinbase transactions. | ||||
// 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); | ||||
//! Utility function to find any unspent output with a given txid. | |||||
const Coin &AccessByTxid(const CCoinsViewCache &cache, const uint256 &txid); | |||||
#endif // BITCOIN_COINS_H | #endif // BITCOIN_COINS_H |