mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #10537: Few Minor per-utxo assert-semantics re-adds and tweak
9417d7a33Be much more agressive in AccessCoin docs. (Matt Corallo)f58349ca8Restore some assert semantics in sigop cost calculations (Matt Corallo)3533fb4d3Return a bool in SpendCoin to restore pre-per-utxo assert semantics (Matt Corallo)ec1271f2bRemove useless mapNextTx lookup in CTxMemPool::TrimToSize. (Matt Corallo) Tree-SHA512: 158a4bce063eac93e1d50709500a10a7cb1fb3271f10ed445d701852fce713e2bf0da3456088e530ab005f194ef4a2adf0c7cb23226b160cecb37a79561f29ca
This commit is contained in:
@@ -91,9 +91,9 @@ void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight) {
|
||||
}
|
||||
}
|
||||
|
||||
void CCoinsViewCache::SpendCoin(const COutPoint &outpoint, Coin* moveout) {
|
||||
bool CCoinsViewCache::SpendCoin(const COutPoint &outpoint, Coin* moveout) {
|
||||
CCoinsMap::iterator it = FetchCoin(outpoint);
|
||||
if (it == cacheCoins.end()) return;
|
||||
if (it == cacheCoins.end()) return false;
|
||||
cachedCoinsUsage -= it->second.coin.DynamicMemoryUsage();
|
||||
if (moveout) {
|
||||
*moveout = std::move(it->second.coin);
|
||||
@@ -104,6 +104,7 @@ void CCoinsViewCache::SpendCoin(const COutPoint &outpoint, Coin* moveout) {
|
||||
it->second.flags |= CCoinsCacheEntry::DIRTY;
|
||||
it->second.coin.Clear();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static const Coin coinEmpty;
|
||||
|
||||
Reference in New Issue
Block a user