7 #ifndef PIVX_NET_PROCESSING_H
8 #define PIVX_NET_PROCESSING_H
16 static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 25;
18 static const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
20 static const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60;
22 static const bool DEFAULT_BLOCK_SPAM_FILTER =
true;
24 static const unsigned int DEFAULT_BLOCK_SPAM_FILTER_MAX_SIZE = 100;
26 static const unsigned int DEFAULT_BLOCK_SPAM_FILTER_MAX_AVG = 10;
30 static const unsigned int INVENTORY_BROADCAST_INTERVAL = 5;
33 static const unsigned int INVENTORY_BROADCAST_MAX = 7 * INVENTORY_BROADCAST_INTERVAL;
The block chain is a tree shaped structure starting with the genesis block at the root,...
Information about a peer.
Implement this to subscribe to events generated in validation.
Capture information about block/transaction validation.
Interface for message handling.
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindex) override
Notifies listeners of a block being connected.
void FinalizeNode(NodeId nodeid, bool &fUpdateConnectionTime) override
void BlockChecked(const CBlock &block, const CValidationState &state) override
bool SendMessages(CNode *pto, std::atomic< bool > &interrupt) override EXCLUSIVE_LOCKS_REQUIRED(pto -> cs_sendProcessing)
Send queued protocol messages to be sent to a give node.
PeerLogicValidation(CConnman *connman)
~PeerLogicValidation()=default
void InitializeNode(CNode *pnode) override
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Notifies listeners when the block chain tip advances.
bool ProcessMessages(CNode *pfrom, std::atomic< bool > &interrupt) override
Process protocol messages received from a given node.
std::chrono::duration< double, std::chrono::seconds::period > SecondsDouble
void Misbehaving(NodeId nodeid, int howmuch, const std::string &message="") EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Increase a node's misbehavior score.
double CountSecondsDouble(SecondsDouble t)
Helper to count the seconds in any std::chrono::duration type.
RecursiveMutex cs_main
Global state.
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
Get statistics from node state.
bool IsBanned(NodeId nodeid)
std::vector< int > vHeightInFlight
uint64_t m_addr_rate_limited
uint64_t m_addr_processed
#define EXCLUSIVE_LOCKS_REQUIRED(...)