Merge 74fb19317a into merged_master (Bitcoin PR bitcoin/bitcoin#30849)

This commit is contained in:
Tom Trevethan 2026-03-31 22:40:02 +01:00
commit a7e8a376fa
17 changed files with 106 additions and 135 deletions

View file

@ -1069,12 +1069,12 @@ bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const
CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }
bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {
std::optional<Coin> CCoinsViewMemPool::GetCoin(const COutPoint& outpoint) const
{
// Check to see if the inputs are made available by another tx in the package.
// These Coins would not be available in the underlying CoinsView.
if (auto it = m_temp_added.find(outpoint); it != m_temp_added.end()) {
coin = it->second;
return true;
return it->second;
}
// If an entry in the mempool exists, always return that one, as it's guaranteed to never
@ -1083,14 +1083,13 @@ bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {
CTransactionRef ptx = mempool.get(outpoint.hash);
if (ptx) {
if (outpoint.n < ptx->vout.size()) {
coin = Coin(ptx->vout[outpoint.n], MEMPOOL_HEIGHT, false);
Coin coin(ptx->vout[outpoint.n], MEMPOOL_HEIGHT, false);
m_non_base_coins.emplace(outpoint);
return true;
} else {
return false;
return coin;
}
return std::nullopt;
}
return base->GetCoin(outpoint, coin);
return base->GetCoin(outpoint);
}
void CCoinsViewMemPool::PackageAddTransaction(const CTransactionRef& tx)