-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Ignore getheaders requests when not synced #6172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore getheaders requests when not synced #6172
Conversation
892bfc7
to
310ddb1
Compare
utACK |
@@ -4174,6 +4174,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, | |||
|
|||
LOCK(cs_main); | |||
|
|||
if (IsInitialBlockDownload()) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we soon and finally apply the clang-format ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's completely inconsequential, but pedantically the return true
should be on the next line and indented.
Tested ACK |
310ddb1
to
a1ba077
Compare
Fixed nit |
Needs to be backported to 0.11 at least |
a1ba077 Ignore getheaders requests when not synced. (Suhas Daftuar)
Shouldn't we still send headers for the blocks we have? |
@rebroad Please see related comment here: #5927 (comment). Before IBD has finished, it's possible to be on a chain that would violate a checkpoint, and responding to a getheaders request at that point could then cause an honest peer to disconnect. |
An improvement over bitcoin#6172. Fixes bitcoin#6971 rather than bypasses it as bitcoin#6974 did, and reduces overloading of whitelisting.
https://botbot.me/freenode/bitcoin-core-dev/msg/75840350/ @gmaxwell your comment recently is MORE applicable here... |
Rebased-From: a1ba077 Github-Pull: bitcoin#6172 (cherry picked from commit b4bbad1)
Sending headers suggests to our peers that they can download from us, so don't respond to getheaders requests while in initial block download (just as we don't relay blocks on tip updates either).