Ignore getheaders requests when not synced #6172

pull sdaftuar wants to merge 1 commits into bitcoin:master from sdaftuar:fix-getheaders-response-when-syncing changing 1 files +3 −0
  1. sdaftuar commented at 6:29 PM on May 21, 2015: member

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

  2. laanwj added the label P2P on May 21, 2015
  3. sdaftuar force-pushed on May 22, 2015
  4. sdaftuar cross-referenced this on May 22, 2015 from issue Reduce checkpoints' effect on consensus. by sipa
  5. laanwj commented at 9:04 AM on May 24, 2015: member

    utACK

  6. in src/main.cpp:None in 310ddb1a8a outdated
    4173 | @@ -4174,6 +4174,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
    4174 |  
    4175 |          LOCK(cs_main);
    4176 |  
    4177 | +        if (IsInitialBlockDownload()) return true;
    


    Diapolo commented at 5:43 PM on May 24, 2015:

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


    laanwj commented at 8:04 AM on May 27, 2015:

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

  7. morcos commented at 9:06 PM on May 24, 2015: member

    Tested ACK

  8. Ignore getheaders requests when not synced. a1ba0778dd
  9. sdaftuar force-pushed on May 27, 2015
  10. sdaftuar commented at 4:21 PM on May 27, 2015: member

    Fixed nit

  11. laanwj commented at 4:33 PM on June 1, 2015: member

    Needs to be backported to 0.11 at least

  12. laanwj added this to the milestone 0.11.0 on Jun 1, 2015
  13. laanwj merged this on Jun 2, 2015
  14. laanwj closed this on Jun 2, 2015

  15. laanwj referenced this in commit 88a7ead5de on Jun 2, 2015
  16. laanwj referenced this in commit b4bbad18ef on Jun 2, 2015
  17. rebroad commented at 8:13 PM on June 8, 2015: contributor

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

  18. sdaftuar commented at 1:31 PM on June 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.

  19. rebroad referenced this in commit 22a4a4fd5c on Nov 2, 2016
  20. rebroad cross-referenced this on Nov 2, 2016 from issue Ignore getheaders prior to passing all checkpoints. by rebroad
  21. rebroad referenced this in commit f5b82fe0bb on Nov 2, 2016
  22. rebroad referenced this in commit f032d43aa0 on Nov 2, 2016
  23. rebroad referenced this in commit 7f68d44c58 on Nov 2, 2016
  24. rebroad referenced this in commit 83d40a910f on Nov 2, 2016
  25. rebroad commented at 5:14 AM on November 4, 2016: contributor

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

  26. rebroad referenced this in commit cc61ff61ea on Nov 4, 2016
  27. rebroad referenced this in commit e58dcdd7ce on Nov 5, 2016
  28. rebroad referenced this in commit 6c0f1ba60f on Nov 5, 2016
  29. rebroad referenced this in commit 0ec255a812 on Nov 6, 2016
  30. rebroad referenced this in commit 65a43abf3a on Nov 6, 2016
  31. rebroad referenced this in commit ec7fac9a23 on Nov 6, 2016
  32. daira cross-referenced this on Mar 4, 2017 from issue Bitcoin 0.12 misc PRs 1 by str4d
  33. daira cross-referenced this on Mar 4, 2017 from issue Improvements to getheaders handling by str4d
  34. pyritepirate referenced this in commit 94831ea0c7 on Jan 25, 2019
  35. reddink referenced this in commit 4f33c94dd8 on Aug 14, 2020
  36. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:55 UTC