upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/test_bip32.cpp
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 08:29:44 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 08:29:44 +0000
commit2c0410b20893383ec6f1c4c8cd5134e420513e80 (patch)
treecb0716e5770e67a429de6f9f8bdf7c0009f980c9 /src/test_bip32.cpp
parent73e77c3bc259a4c8e0a4cc5c376f1a9545439bdd (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/test_bip32.cpp')
0 files changed, 0 insertions, 0 deletions