aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.h
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2018-08-22 23:29:01 +0000
committerGregory Maxwell <greg@xiph.org>2018-08-23 10:10:12 +0000
commit66b3fc543706aad1aaccc403b4ee08f65fa5d17b (patch)
treea3e42c57603ce50c6e7fba55629f68af7c287fec /src/net_processing.h
parent271b379e636afa419c5208cb462c07090490266c (diff)
downloadbitcoin-66b3fc543706aad1aaccc403b4ee08f65fa5d17b.tar.xz
Skip stale tip checking if outbound connections are off or if reindexing.
Diffstat (limited to 'src/net_processing.h')
-rw-r--r--src/net_processing.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net_processing.h b/src/net_processing.h
index 7caefc80ca..01b8e97075 100644
--- a/src/net_processing.h
+++ b/src/net_processing.h
@@ -9,6 +9,9 @@
#include <net.h>
#include <validationinterface.h>
#include <consensus/params.h>
+#include <sync.h>
+
+extern CCriticalSection cs_main;
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
@@ -65,7 +68,7 @@ public:
/** 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);
private:
int64_t m_stale_tip_check_time; //! Next time to check for stale tip