Skip to content
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

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

Merged
merged 1 commit into from Sep 27, 2018
Merged

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

merged 1 commit into from Sep 27, 2018

Conversation

@gmaxwell
Copy link
Contributor

@gmaxwell gmaxwell commented Aug 22, 2018

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

@fanquake fanquake added the P2P label Aug 22, 2018
@fanquake
Copy link
Member

@fanquake fanquake commented Aug 23, 2018

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

@promag
Copy link
Member

@promag promag commented Aug 23, 2018

Concept ACK.

@promag
Copy link
Member

@promag promag commented Aug 23, 2018

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?

Copy link
Member

@MarcoFalke MarcoFalke left a comment

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

src/net.h Outdated
@@ -416,6 +418,7 @@ class CConnman
int nMaxOutbound;
int nMaxAddnode;
int nMaxFeeler;
bool fUseAddrmanOutgoing;
Copy link
Member

@MarcoFalke MarcoFalke Aug 23, 2018

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

@@ -3154,7 +3154,7 @@ void PeerLogicValidation::ConsiderEviction(CNode *pto, int64_t time_in_seconds)
}
}

void PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds)
void PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Copy link
Member

@MarcoFalke MarcoFalke Aug 23, 2018

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

@@ -65,7 +65,7 @@ class PeerLogicValidation final : public CValidationInterface, public NetEventsI
/** Evict extra outbound peers. If we think our tip may be stale, connect to an extra outbound */
void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams);
/** If we have extra outbound peers, try to disconnect the one with the oldest block announcement */
void EvictExtraOutboundPeers(int64_t time_in_seconds);
void EvictExtraOutboundPeers(int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
Copy link
Member

@MarcoFalke MarcoFalke Aug 23, 2018

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

Or just a forward decl:

+class CCriticalSection;
+extern CCriticalSection cs_main;

@gmaxwell
Copy link
Contributor Author

@gmaxwell gmaxwell commented Aug 23, 2018

@MarcoFalke how about now? :)

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Aug 23, 2018

Concept ACK

Increases signal to noise in our logging

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Aug 23, 2018

re-utACK 66b3fc5

@sdaftuar
Copy link
Member

@sdaftuar sdaftuar commented Sep 10, 2018

ACK

@promag
Copy link
Member

@promag promag commented Sep 10, 2018

utACK 66b3fc5.

@ken2812221
Copy link
Contributor

@ken2812221 ken2812221 commented Sep 27, 2018

utACK 66b3fc5

@MarcoFalke MarcoFalke merged commit 66b3fc5 into bitcoin:master Sep 27, 2018
2 checks passed
MarcoFalke added a commit that referenced this issue Sep 27, 2018
… or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Apr 16, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Apr 16, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Apr 19, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Apr 20, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue May 10, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue May 12, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
deadalnix added a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Jun 8, 2020
…ing.

Summary: This is a backport of Core [[bitcoin/bitcoin#14027 | PR14027]]

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6452
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 9, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 9, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 10, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 11, 2020
…are off or if reindexing.

66b3fc5 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

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

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
ftrader added a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this issue Aug 17, 2020
…ing.

Summary: This is a backport of Core [[bitcoin/bitcoin#14027 | PR14027]]

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6452
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants