diff options
author | James O'Beirne <james.obeirne@pm.me> | 2020-08-25 13:50:23 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2021-02-12 07:53:29 -0600 |
commit | f6e2da5fb7c6406c37612c838c998078ea8d2252 (patch) | |
tree | a543e8de37216084fe3cc7a32234e873377003e5 /src/coins.cpp | |
parent | 7a6c46b37edb8bfa0085d202aa7e9427d5e4fceb (diff) |
simplify ChainstateManager::SnapshotBlockhash() return semantics
Don't return null snapshotblockhash values to avoid caller complexity/confusion.
Diffstat (limited to 'src/coins.cpp')
-rw-r--r-- | src/coins.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/coins.cpp b/src/coins.cpp index dd84e720e7..d52851cadd 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -97,6 +97,14 @@ void CCoinsViewCache::AddCoin(const COutPoint &outpoint, Coin&& coin, bool possi cachedCoinsUsage += it->second.coin.DynamicMemoryUsage(); } +void CCoinsViewCache::EmplaceCoinInternalDANGER(COutPoint&& outpoint, Coin&& coin) { + cachedCoinsUsage += coin.DynamicMemoryUsage(); + cacheCoins.emplace( + std::piecewise_construct, + std::forward_as_tuple(std::move(outpoint)), + std::forward_as_tuple(std::move(coin), CCoinsCacheEntry::DIRTY)); +} + void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight, bool check_for_overwrite) { bool fCoinbase = tx.IsCoinBase(); const uint256& txid = tx.GetHash(); |