HomePhabricator

Don't send getheaders message when another request is outstanding

Description

Don't send getheaders message when another request is outstanding

Summary:
Change getheaders messages so that we wait up to 2 minutes for a response to a
prior getheaders message before issuing a new one.

Also change the handling of the getheaders message sent in response to a block
INV, so that we no longer use the hashstop variable (including the hash stop
will just mean that if our peer's headers chain is longer, then we won't learn
it, so there's no benefit to using hashstop).

Also, now respond to a getheaders during IBD with an empty headers message
(rather than nothing) -- this better conforms to the intent of the new logic
that it's better to not ignore a peer's getheaders message, even if you have
nothing to give. This also avoids a lot of functional tests breaking.

This concludes backport of core#25454 and core#25557
https://github.com/bitcoin/bitcoin/pull/25454/commits/abf5d16c24cb08b0451bdbd4d1de63a12930e8f5
https://github.com/bitcoin/bitcoin/pull/25454/commits/99f4785cad94657dcf349d00fdd6f1d44cac9bb0
https://github.com/bitcoin/bitcoin/pull/25557/commits/e939cf2b7645c2b20a68cb6129f3aebfdf287d61

Depends on D14912

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14913

Details

Provenance
Suhas Daftuar <sdaftuar@gmail.com>Authored on Mar 3 2022, 19:48
PiRKCommitted on Dec 6 2023, 09:46
PiRKPushed on Dec 6 2023, 09:47
Reviewer
Restricted Project
Differential Revision
D14913: Don't send getheaders message when another request is outstanding
Parents
rABC598693e5878f: [Cashtab][Alias] Add trimmed input null check after input clearance
Branches
Unknown
Tags
Unknown