Skip stale tip checking if outbound connections are off or if reindexing. #14027

pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:2018_08_noout_noextra changing 3 files +10 −5
  1. gmaxwell commented at 11:51 PM on August 22, 2018: contributor

    I got tired of the pointless stale tip notices in reindex and on nodes with connections disabled.

  2. fanquake added the label P2P on Aug 22, 2018
  3. fanquake commented at 12:19 AM on August 23, 2018: member

    macOS build failed on Travis with:

      CXX      libbitcoin_server_a-torcontrol.o
    In file included from net_processing.cpp:6:
    ./net_processing.h:68:84: error: use of undeclared identifier 'cs_main'
        void EvictExtraOutboundPeers(int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
                                                                                       ^
    ./threadsafety.h:31:79: note: expanded from macro 'EXCLUSIVE_LOCKS_REQUIRED'
    #define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__((exclusive_locks_required(__VA_ARGS__)))
                                                                                  ^
    1 error generated.
    Makefile:6006: recipe for target 'libbitcoin_server_a-net_processing.o' failed
    
  4. promag commented at 12:52 AM on August 23, 2018: member

    Concept ACK.

  5. in src/net.h:421 in 73b1272521 outdated
     417 | @@ -416,6 +418,7 @@ class CConnman
     418 |      int nMaxOutbound;
     419 |      int nMaxAddnode;
     420 |      int nMaxFeeler;
     421 | +    bool fUseAddrmanOutgoing;
    


    MarcoFalke commented at 12:58 AM on August 23, 2018:

    nit: Members should be snake_case and prefixed with m_ to distinguish them from non-members

  6. in src/net_processing.cpp:3157 in 73b1272521 outdated
    3153 | @@ -3154,7 +3154,7 @@ void PeerLogicValidation::ConsiderEviction(CNode *pto, int64_t time_in_seconds)
    3154 |      }
    3155 |  }
    3156 |  
    3157 | -void PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds)
    3158 | +void PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
    


    MarcoFalke commented at 12:59 AM on August 23, 2018:

    nit: Should be enough to put this into the header file.

  7. in src/net_processing.h:71 in 73b1272521 outdated
      64 | @@ -65,7 +65,7 @@ class PeerLogicValidation final : public CValidationInterface, public NetEventsI
      65 |      /** Evict extra outbound peers. If we think our tip may be stale, connect to an extra outbound */
      66 |      void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams);
      67 |      /** If we have extra outbound peers, try to disconnect the one with the oldest block announcement */
      68 | -    void EvictExtraOutboundPeers(int64_t time_in_seconds);
      69 | +    void EvictExtraOutboundPeers(int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
    


    MarcoFalke commented at 12:59 AM on August 23, 2018:

    Missing extern CCriticalSection cs_main; and #include <sync.h> further up?

    Or just a forward decl:

    +class CCriticalSection;
    +extern CCriticalSection cs_main;
    
  8. promag commented at 1:01 AM on August 23, 2018: member

    Restarted travis job, looks unrelated.

    Edit: ops, didn't see that @fanquake. I guess #include <validation.h> should be moved from net_processing.cpp to net_processing.h. Or adding extern CCriticalSection cs_main is acceptable?

  9. MarcoFalke commented at 1:11 AM on August 23, 2018: member

    utACK 73b1272521b88f7dde9b8774968943116767cccf (doesn't compile for me, though)

  10. gmaxwell commented at 2:45 AM on August 23, 2018: contributor

    @MarcoFalke how about now? :)

  11. practicalswift commented at 8:07 AM on August 23, 2018: contributor

    Concept ACK

    Increases signal to noise in our logging

  12. Skip stale tip checking if outbound connections are off or if reindexing. 66b3fc5437
  13. MarcoFalke commented at 11:53 AM on August 23, 2018: member

    re-utACK 66b3fc543706aad1aaccc403b4ee08f65fa5d17b

  14. sdaftuar commented at 3:00 PM on September 10, 2018: member

    ACK

  15. promag commented at 8:58 PM on September 10, 2018: member

    utACK 66b3fc5.

  16. ken2812221 commented at 9:14 AM on September 27, 2018: contributor

    utACK 66b3fc543706aad1aaccc403b4ee08f65fa5d17b

  17. MarcoFalke merged this on Sep 27, 2018
  18. MarcoFalke closed this on Sep 27, 2018

  19. MarcoFalke referenced this in commit 423cb37658 on Sep 27, 2018
  20. PastaPastaPasta referenced this in commit 69c399f533 on Apr 16, 2020
  21. PastaPastaPasta referenced this in commit eed4322876 on Apr 16, 2020
  22. PastaPastaPasta referenced this in commit 33bdd4b020 on Apr 19, 2020
  23. PastaPastaPasta referenced this in commit b0e22cbf7e on Apr 20, 2020
  24. PastaPastaPasta referenced this in commit a7925d0d66 on May 10, 2020
  25. PastaPastaPasta referenced this in commit 6893c86d88 on May 12, 2020
  26. deadalnix referenced this in commit 36b3d31a10 on Jun 8, 2020
  27. PastaPastaPasta referenced this in commit 490ef353c2 on Jun 9, 2020
  28. PastaPastaPasta referenced this in commit 9ab6626d17 on Jun 9, 2020
  29. PastaPastaPasta referenced this in commit f5d65e0355 on Jun 10, 2020
  30. PastaPastaPasta referenced this in commit 7ae20523a9 on Jun 11, 2020
  31. ftrader referenced this in commit ea75a9a6de on Aug 17, 2020
  32. MarcoFalke 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-04-16 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me