diff options
author | John Newbery <john@johnnewbery.com> | 2020-03-23 10:45:34 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2020-04-21 14:19:15 -0400 |
commit | 21fa0a44abe8c1b5c452e097eab20cf0ae988805 (patch) | |
tree | 4d3c982ba590833e9e949c55ec504e3b65fdc1bf /src/coins.cpp | |
parent | 2685c214cce4b07695273503e60350e3f05fe3e2 (diff) |
[docs] use consistent naming for possible_overwrite
And other general comment improvements for adding coins.
Diffstat (limited to 'src/coins.cpp')
-rw-r--r-- | src/coins.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/coins.cpp b/src/coins.cpp index 9e0dd6cd9f..6b4cb2aec7 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -99,12 +99,12 @@ void CCoinsViewCache::AddCoin(const COutPoint &outpoint, Coin&& coin, bool possi cachedCoinsUsage += it->second.coin.DynamicMemoryUsage(); } -void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight, bool check) { +void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight, bool check_for_overwrite) { bool fCoinbase = tx.IsCoinBase(); const uint256& txid = tx.GetHash(); for (size_t i = 0; i < tx.vout.size(); ++i) { - bool overwrite = check ? cache.HaveCoin(COutPoint(txid, i)) : fCoinbase; - // Always set the possible_overwrite flag to AddCoin for coinbase txn, in order to correctly + bool overwrite = check_for_overwrite ? cache.HaveCoin(COutPoint(txid, i)) : fCoinbase; + // Coinbase transactions can always be overwritten, in order to correctly // deal with the pre-BIP30 occurrences of duplicate coinbase transactions. cache.AddCoin(COutPoint(txid, i), Coin(tx.vout[i], nHeight, fCoinbase), overwrite); } |