Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.h
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | void ProcessMessage(const Config &config, CNode &pfrom, | ||||
const std::atomic<bool> &interruptMsgProc); | const std::atomic<bool> &interruptMsgProc); | ||||
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; | ||||
}; | }; | ||||
struct CNodeStateStats { | struct CNodeStateStats { | ||||
int nMisbehavior = 0; | int m_misbehavior_score = 0; | ||||
int nSyncHeight = -1; | int nSyncHeight = -1; | ||||
int nCommonHeight = -1; | int nCommonHeight = -1; | ||||
std::vector<int> vHeightInFlight; | std::vector<int> vHeightInFlight; | ||||
}; | }; | ||||
/** Get statistics from node state */ | /** Get statistics from node state */ | ||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); | bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); | ||||
/** | /** | ||||
* Increment peer's misbehavior score. If the new value >= | * Increment peer's misbehavior score. If the new value >= | ||||
* DISCOURAGEMENT_THRESHOLD, mark the node to be discouraged, meaning the peer | * DISCOURAGEMENT_THRESHOLD, mark the node to be discouraged, meaning the peer | ||||
* might be disconnected and added to the discouragement filter. | * might be disconnected and added to the discouragement filter. | ||||
*/ | */ | ||||
void Misbehaving(const NodeId nodeid, const int howmuch, | void Misbehaving(const NodeId nodeid, const int howmuch, | ||||
const std::string &message = "") | const std::string &message = ""); | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | |||||
/** 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); | ||||
#endif // BITCOIN_NET_PROCESSING_H | #endif // BITCOIN_NET_PROCESSING_H |