Skip to content

Commit 7b8553f

Browse files
committed
Merge bitcoin#27626: Parallel compact block downloads, take 3
This is a backport of bitcoin#27626 This PR attempts to mitigate a single case, where high bandwidth peers can bail us out of a flakey peer not completing blocks for us. We allow up to 2 additional getblocktxns requests per unique block. This would hopefully allow the chance for an honest high bandwidth peer to hand us the transactions even if the first in flight peer stalls out. Changes: - Convert mapBlocksInFlight from std::map to std::multimap to allow multiple peers to be downloading the same block - Add IsBlockRequestedFromOutbound() to check if block is being fetched from an outbound peer - Update RemoveBlockRequest() to take optional from_peer parameter to selectively remove only that peers request - Add MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK = 3 constant - Remove nBlocksInFlight counter, use vBlocksInFlight.size() instead - Add parallel download test in p2p_compactblocks.py Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e63410e commit 7b8553f

File tree

5 files changed

+257
-80
lines changed

5 files changed

+257
-80
lines changed

src/net.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ class CNodeStats
221221
int nVersion;
222222
std::string cleanSubVer;
223223
bool fInbound;
224+
// We requested high bandwidth connection to peer
224225
bool m_bip152_highbandwidth_to;
226+
// Peer requested high bandwidth connection
225227
bool m_bip152_highbandwidth_from;
226228
int m_starting_height;
227229
uint64_t nSendBytes;

0 commit comments

Comments
 (0)