mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Skip stale tip checking if outbound connections are off or if reindexing.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user