Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_NET_PROCESSING_H | #ifndef BITCOIN_NET_PROCESSING_H | ||||
#define BITCOIN_NET_PROCESSING_H | #define BITCOIN_NET_PROCESSING_H | ||||
#include <consensus/params.h> | #include <consensus/params.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <sync.h> | |||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
extern RecursiveMutex cs_main; | |||||
class Config; | class Config; | ||||
/** | /** | ||||
* Default for -maxorphantx, maximum number of orphan transactions kept in | * Default for -maxorphantx, maximum number of orphan transactions kept in | ||||
* memory. | * memory. | ||||
*/ | */ | ||||
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100; | static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | public: | ||||
* an extra outbound. | * an extra outbound. | ||||
*/ | */ | ||||
void | void | ||||
CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams); | CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams); | ||||
/** | /** | ||||
* If we have extra outbound peers, try to disconnect the one with the | * If we have extra outbound peers, try to disconnect the one with the | ||||
* oldest block announcement. | * oldest block announcement. | ||||
*/ | */ | ||||
void EvictExtraOutboundPeers(int64_t time_in_seconds); | void EvictExtraOutboundPeers(int64_t time_in_seconds) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | |||||
private: | private: | ||||
//! Next time to check for stale tip | //! Next time to check for stale tip | ||||
int64_t m_stale_tip_check_time; | int64_t m_stale_tip_check_time; | ||||
/** Enable BIP61 (sending reject messages) */ | /** Enable BIP61 (sending reject messages) */ | ||||
const bool m_enable_bip61; | const bool m_enable_bip61; | ||||
}; | }; | ||||
Show All 17 Lines |