mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge 74fb19317a into merged_master (Bitcoin PR bitcoin/bitcoin#30849)
This commit is contained in:
commit
a7e8a376fa
17 changed files with 106 additions and 135 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue