mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Do not flush the cache after every block outside of IBD
This commit is contained in:
@@ -107,7 +107,12 @@ bool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) {
|
||||
}
|
||||
|
||||
bool CCoinsViewCache::HaveCoins(const uint256 &txid) {
|
||||
return FetchCoins(txid) != cacheCoins.end();
|
||||
CCoinsMap::iterator it = FetchCoins(txid);
|
||||
// We're using vtx.empty() instead of IsPruned here for performance reasons,
|
||||
// as we only care about the case where an 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.vout.empty());
|
||||
}
|
||||
|
||||
uint256 CCoinsViewCache::GetBestBlock() {
|
||||
|
||||
Reference in New Issue
Block a user