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

@ -876,10 +876,9 @@ static bool rest_getutxos(const std::any& context, HTTPRequest* req, const std::
{
auto process_utxos = [&vOutPoints, &outs, &hits, &active_height, &active_hash, &chainman](const CCoinsView& view, const CTxMemPool* mempool) EXCLUSIVE_LOCKS_REQUIRED(chainman.GetMutex()) {
for (const COutPoint& vOutPoint : vOutPoints) {
Coin coin;
bool hit = (!mempool || !mempool->isSpent(vOutPoint)) && view.GetCoin(vOutPoint, coin);
hits.push_back(hit);
if (hit) outs.emplace_back(std::move(coin));
auto coin = !mempool || !mempool->isSpent(vOutPoint) ? view.GetCoin(vOutPoint) : std::nullopt;
hits.push_back(coin.has_value());
if (coin) outs.emplace_back(std::move(*coin));
}
active_height = chainman.ActiveHeight();
active_hash = chainman.ActiveTip()->GetBlockHash();