mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 18:52:29 +02:00
refactor: encapsulate flags access for dirty and fresh checks
No behavior change. This prepares moving the cache entry flags field to private access. Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
@@ -58,7 +58,7 @@ public:
|
||||
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock, bool erase = true) override
|
||||
{
|
||||
for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); it = erase ? mapCoins.erase(it) : std::next(it)) {
|
||||
if (it->second.flags & CCoinsCacheEntry::DIRTY) {
|
||||
if (it->second.IsDirty()) {
|
||||
// Same optimization used in CCoinsViewDB is to only write dirty entries.
|
||||
map_[it->first] = it->second.coin;
|
||||
if (it->second.coin.IsSpent() && InsecureRandRange(3) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user