diff options
author | Daniel Kraft <d@domob.eu> | 2016-05-15 20:15:02 +0200 |
---|---|---|
committer | Daniel Kraft <d@domob.eu> | 2016-05-15 20:15:02 +0200 |
commit | f93c2a1b7ee912f0651ebb4c8a5eca220e434f4a (patch) | |
tree | 0f742daed8fd5989c05ff2640ee5ab6d844fabb7 /src/zmq | |
parent | 169d379c98357a17e634f34b5e72033c69f9a7cb (diff) |
net: Avoid duplicate getheaders requests.
The current logic for syncing headers may lead to lots of duplicate
getheaders requests being sent: If a new block arrives while the node
is in headers sync, it will send getheaders in response to the block
announcement. When the headers arrive, the message will be of maximum
size and so a follow-up request will be sent---all of that in addition
to the existing headers syncing. This will create a second "chain" of
getheaders requests. If more blocks arrive, this may even lead to
arbitrarily many parallel chains of redundant requests.
This patch changes the behaviour to only request more headers after a
maximum-sized message when it contained at least one unknown header.
This avoids sustaining parallel chains of redundant requests.
Note that this patch avoids the issues raised in the discussion of
https://github.com/bitcoin/bitcoin/pull/6821: There is no risk of the
node being permanently blocked. At the latest when a new block arrives
this will trigger a new getheaders request and restart syncing.
Diffstat (limited to 'src/zmq')
0 files changed, 0 insertions, 0 deletions