bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const { CCoinsMap::const_iterator it = FetchCoins(txid); if (it != cacheCoins.end()) { coins = it->second.coins; return true; } return false; }
CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) { if(txid == always_spendable_txid){ return zerocoin_input; } std::map<uint256,CCoins>::iterator it = FetchCoins(txid); assert(it != cacheCoins.end()); return it->second; }
bool CCoinsViewCache::HaveCoins(const uint256 &txid) const { CCoinsMap::const_iterator it = FetchCoins(txid); // We're using vtx.empty() instead of IsPruned here for performance reasons, // as we only care about the case where a transaction was replaced entirely // in a reorganization (which wipes vout entirely, as opposed to spending // which just cleans individual outputs). return (it != cacheCoins.end() && !it->second.coins.vout.empty()); }
const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const { CCoinsMap::const_iterator it = FetchCoins(txid); if (it == cacheCoins.end()) { return NULL; } else { return &it->second.coins; } }
bool CCoinsViewCache::HaveCoins(const uint256 &txid) { if(txid == always_spendable_txid){ return true; } return FetchCoins(txid) != cacheCoins.end(); }
CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) { std::map<uint256,CCoins>::iterator it = FetchCoins(txid); assert(it != cacheCoins.end()); return it->second; }
bool CCoinsViewCache::HaveCoins(const uint256 &txid) { return FetchCoins(txid) != cacheCoins.end(); }
bool CCoinsViewCache::HaveCoins(const uint256& txid) const { CCoinsMap::const_iterator it = FetchCoins(txid); return (it != cacheCoins.end() && !it->second.coins.vout.empty()); }