Merge 24ced52744 into merged_master (Bitcoin PR bitcoin/bitcoin#28687)

This commit is contained in:
ivanlele 2026-03-12 13:25:17 +00:00
commit 23859ef13f
No known key found for this signature in database
9 changed files with 22 additions and 66 deletions

View file

@ -32,7 +32,6 @@
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <random.h>
#include <reverse_iterator.h>
#include <scheduler.h>
#include <streams.h>
#include <sync.h>
@ -51,6 +50,7 @@
#include <future>
#include <memory>
#include <optional>
#include <ranges>
#include <typeinfo>
#include <utility>
@ -2263,7 +2263,7 @@ void PeerManagerImpl::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlock
for (auto& it : m_peer_map) {
Peer& peer = *it.second;
LOCK(peer.m_block_inv_mutex);
for (const uint256& hash : reverse_iterate(vHashes)) {
for (const uint256& hash : vHashes | std::views::reverse) {
peer.m_blocks_for_headers_relay.push_back(hash);
}
}
@ -2956,7 +2956,7 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c
} else {
std::vector<CInv> vGetData;
// Download as much as possible, from earliest to latest.
for (const CBlockIndex *pindex : reverse_iterate(vToFetch)) {
for (const CBlockIndex* pindex : vToFetch | std::views::reverse) {
if (nodestate->vBlocksInFlight.size() >= MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
// Can't download any more from this peer
break;