Commit 7b8553f
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- src
- rpc
- test/functional
5 files changed
+257
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
224 | 225 | | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| |||
0 commit comments