Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.h
Show All 30 Lines | |||||
static const bool DEFAULT_PEERBLOCKFILTERS = false; | static const bool DEFAULT_PEERBLOCKFILTERS = false; | ||||
/** Threshold for marking a node to be discouraged, e.g. disconnected and added | /** Threshold for marking a node to be discouraged, e.g. disconnected and added | ||||
* to the discouragement filter. */ | * to the discouragement filter. */ | ||||
static const int DISCOURAGEMENT_THRESHOLD{100}; | static const int DISCOURAGEMENT_THRESHOLD{100}; | ||||
class PeerLogicValidation final : public CValidationInterface, | class PeerLogicValidation final : public CValidationInterface, | ||||
public NetEventsInterface { | public NetEventsInterface { | ||||
public: | public: | ||||
PeerLogicValidation(CConnman &connman, BanMan *banman, | PeerLogicValidation(const CChainParams &chainparams, CConnman &connman, | ||||
CScheduler &scheduler, ChainstateManager &chainman, | BanMan *banman, CScheduler &scheduler, | ||||
CTxMemPool &pool); | ChainstateManager &chainman, CTxMemPool &pool); | ||||
/** | /** | ||||
* Overridden from CValidationInterface. | * Overridden from CValidationInterface. | ||||
*/ | */ | ||||
void BlockConnected(const std::shared_ptr<const CBlock> &pblock, | void BlockConnected(const std::shared_ptr<const CBlock> &pblock, | ||||
const CBlockIndex *pindexConnected) override; | const CBlockIndex *pindexConnected) override; | ||||
void BlockDisconnected(const std::shared_ptr<const CBlock> &block, | void BlockDisconnected(const std::shared_ptr<const CBlock> &block, | ||||
const CBlockIndex *pindex) override; | const CBlockIndex *pindex) override; | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | private: | ||||
* address. | * address. | ||||
* | * | ||||
* @param[in] pnode The node to check. | * @param[in] pnode The node to check. | ||||
* @return True if the peer was marked for disconnection in | * @return True if the peer was marked for disconnection in | ||||
* this function | * this function | ||||
*/ | */ | ||||
bool MaybeDiscourageAndDisconnect(CNode &pnode); | bool MaybeDiscourageAndDisconnect(CNode &pnode); | ||||
const CChainParams &m_chainparams; | |||||
CConnman &m_connman; | CConnman &m_connman; | ||||
/** | /** | ||||
* Pointer to this node's banman. May be nullptr - check existence before | * Pointer to this node's banman. May be nullptr - check existence before | ||||
* dereferencing. | * dereferencing. | ||||
*/ | */ | ||||
BanMan *const m_banman; | BanMan *const m_banman; | ||||
ChainstateManager &m_chainman; | ChainstateManager &m_chainman; | ||||
CTxMemPool &m_mempool; | CTxMemPool &m_mempool; | ||||
Show All 26 Lines |