Ignore getheaders requests when not synced #6172

Merged
merged 1 commit into from Jun 2, 2015

Conversation

Projects
None yet
5 participants
@sdaftuar
Member

sdaftuar commented May 21, 2015

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).

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj May 24, 2015

Member

utACK

Member

laanwj commented May 24, 2015

utACK

src/main.cpp
@@ -4174,6 +4174,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
LOCK(cs_main);
+ if (IsInitialBlockDownload()) return true;

This comment has been minimized.

@Diapolo

Diapolo May 24, 2015

I hope we soon and finally apply the clang-format ;).

@Diapolo

Diapolo May 24, 2015

I hope we soon and finally apply the clang-format ;).

This comment has been minimized.

@laanwj

laanwj May 27, 2015

Member

Yes, it's completely inconsequential, but pedantically the return true should be on the next line and indented.

@laanwj

laanwj May 27, 2015

Member

Yes, it's completely inconsequential, but pedantically the return true should be on the next line and indented.

@morcos

This comment has been minimized.

Show comment
Hide comment
@morcos

morcos May 24, 2015

Member

Tested ACK

Member

morcos commented May 24, 2015

Tested ACK

@sdaftuar

This comment has been minimized.

Show comment
Hide comment
@sdaftuar

sdaftuar May 27, 2015

Member

Fixed nit

Member

sdaftuar commented May 27, 2015

Fixed nit

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jun 1, 2015

Member

Needs to be backported to 0.11 at least

Member

laanwj commented Jun 1, 2015

Needs to be backported to 0.11 at least

@laanwj laanwj added this to the 0.11.0 milestone Jun 1, 2015

@laanwj laanwj merged commit a1ba077 into bitcoin:master Jun 2, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Jun 2, 2015

Merge pull request #6172
a1ba077 Ignore getheaders requests when not synced. (Suhas Daftuar)

laanwj added a commit that referenced this pull request Jun 2, 2015

@rebroad

This comment has been minimized.

Show comment
Hide comment
@rebroad

rebroad Jun 8, 2015

Contributor

Shouldn't we still send headers for the blocks we have?

Contributor

rebroad commented Jun 8, 2015

Shouldn't we still send headers for the blocks we have?

@sdaftuar

This comment has been minimized.

Show comment
Hide comment
@sdaftuar

sdaftuar Jun 10, 2015

Member

@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.

Member

sdaftuar commented Jun 10, 2015

@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.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 2, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 2, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 2, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 2, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 2, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.
@rebroad

This comment has been minimized.

Show comment
Hide comment
@rebroad

rebroad Nov 4, 2016

Contributor

https://botbot.me/freenode/bitcoin-core-dev/msg/75840350/ @gmaxwell your comment recently is MORE applicable here...

Contributor

rebroad commented Nov 4, 2016

https://botbot.me/freenode/bitcoin-core-dev/msg/75840350/ @gmaxwell your comment recently is MORE applicable here...

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 4, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 5, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 5, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 6, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 6, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.

rebroad added a commit to rebroad/bitcoin that referenced this pull request Nov 6, 2016

Ignore getheaders prior to passing all checkpoints.
An improvement over #6172. Fixes #6971 rather than bypasses it
as #6974 did, and reduces overloading of whitelisting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment