Commit df8d578
committed
bch(M5): drop evicted-then-arrived block from the download queue
expire() requeues a timed-out in-flight block to the FRONT of the pending
queue and records it in m_evicted. If the (merely slow) peer then delivers
that block, on_block_received bumped false_evict_count but left the hash in
the queue -- so the next next_requests() drain re-getdata'd a block already
in hand. Remove the hash from the queue on the false-evict path (linear scan;
eviction is rare, healthy sync keeps false_evict at 0). A hash already
re-issued sits in m_in_flight, not the queue, so the scan is a no-op there.
Adds an evicted-then-arrived test pinning both legs: false_evict_count flags
the premature eviction (distinct from a clean arrival) AND queued()==0 / a
following drain is empty -- no re-download. Refreshes the stale header note
that still claimed eviction was deferred (it is implemented and NodeP2P-driven).
PURE block-download window plumbing; p2pool-merged-v36 surface NONE; per-coin
isolation src/impl/bch/ only; header + test build-inert (bch skip-green).1 parent d7c6df2 commit df8d578
2 files changed
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
113 | 125 | | |
114 | 126 | | |
115 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
204 | 232 | | |
205 | 233 | | |
206 | 234 | | |
0 commit comments