diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 08:29:44 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 08:29:44 +0000 |
| commit | 2c0410b20893383ec6f1c4c8cd5134e420513e80 (patch) | |
| tree | cb0716e5770e67a429de6f9f8bdf7c0009f980c9 /src/util.cpp | |
| parent | 73e77c3bc259a4c8e0a4cc5c376f1a9545439bdd (diff) | |
net: fail over a stalled block fetch to another peer
The 15s retry spacing only helps when several peers announce the block:
the queued retries are created by inv handling, so a block announced by
a single peer that then goes quiet was re-requested from nobody, and the
tip stayed frozen until somebody happened to re-announce (#33).
Track every block getdata in mapBlockFetch, erase the entry when the
body arrives, and let SendMessages re-issue a request that has gone
unanswered for BLOCK_FETCH_RETRY_SECS to the next peer that has not had
a turn this round, restarting the round once every connected peer has.
Client peers are skipped -- they declared they cannot serve bodies.
Tracking is capped at 8 in-flight blocks so initial download, where
hundreds are legitimately outstanding to one peer, is not duplicated to
everybody else, and an entry is dropped after 10 minutes so a hash that
was announced and never existed cannot be chased forever.
The failover log line is deliberately not behind a debug category: it
firing means a peer announces blocks it does not serve, which is the
pathology being diagnosed.
Diffstat (limited to 'src/util.cpp')
0 files changed, 0 insertions, 0 deletions