Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.h
Show All 28 Lines | |||||
static const bool DEFAULT_PEERBLOCKFILTERS = false; | static const bool DEFAULT_PEERBLOCKFILTERS = false; | ||||
class PeerLogicValidation final : public CValidationInterface, | class PeerLogicValidation final : public CValidationInterface, | ||||
public NetEventsInterface { | public NetEventsInterface { | ||||
private: | private: | ||||
CConnman *const connman; | CConnman *const connman; | ||||
BanMan *const m_banman; | BanMan *const m_banman; | ||||
bool CheckIfBanned(CNode *pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main); | bool CheckIfBanned(CNode &pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
public: | public: | ||||
PeerLogicValidation(CConnman *connman, BanMan *banman, | PeerLogicValidation(CConnman *connman, BanMan *banman, | ||||
CScheduler &scheduler); | CScheduler &scheduler); | ||||
/** | /** | ||||
* Overridden from CValidationInterface. | * Overridden from CValidationInterface. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public: | ||||
bool SendMessages(const Config &config, CNode *pto, | bool SendMessages(const Config &config, CNode *pto, | ||||
std::atomic<bool> &interrupt) override | std::atomic<bool> &interrupt) override | ||||
EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing); | EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing); | ||||
/** | /** | ||||
* Consider evicting an outbound peer based on the amount of time they've | * Consider evicting an outbound peer based on the amount of time they've | ||||
* been behind our tip. | * been behind our tip. | ||||
*/ | */ | ||||
void ConsiderEviction(CNode *pto, int64_t time_in_seconds) | void ConsiderEviction(CNode &pto, int64_t time_in_seconds) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** | /** | ||||
* Evict extra outbound peers. If we think our tip may be stale, connect to | * Evict extra outbound peers. If we think our tip may be stale, connect to | ||||
* an extra outbound. | * an extra outbound. | ||||
*/ | */ | ||||
void | void | ||||
CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams); | CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams); | ||||
/** | /** | ||||
Show All 18 Lines | |||||
/** Get statistics from node state */ | /** Get statistics from node state */ | ||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); | bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); | ||||
/** Increase a node's misbehavior score. */ | /** Increase a node's misbehavior score. */ | ||||
void Misbehaving(NodeId nodeid, int howmuch, const std::string &reason = ""); | void Misbehaving(NodeId nodeid, int howmuch, const std::string &reason = ""); | ||||
/** Relay transaction to every node */ | /** Relay transaction to every node */ | ||||
void RelayTransaction(const TxId &txid, const CConnman &connman); | void RelayTransaction(const TxId &txid, const CConnman &connman); | ||||
bool ProcessMessage(const Config &config, CNode *pfrom, | bool ProcessMessage(const Config &config, CNode &pfrom, | ||||
const std::string &msg_type, CDataStream &vRecv, | const std::string &msg_type, CDataStream &vRecv, | ||||
int64_t nTimeReceived, CConnman *connman, BanMan *banman, | int64_t nTimeReceived, CConnman *connman, BanMan *banman, | ||||
const std::atomic<bool> &interruptMsgProc); | const std::atomic<bool> &interruptMsgProc); | ||||
#endif // BITCOIN_NET_PROCESSING_H | #endif // BITCOIN_NET_PROCESSING_H |