Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

net_processing.h File Reference
#include <net.h>
#include <validationinterface.h>
#include <consensus/params.h>
+ Include dependency graph for net_processing.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PeerLogicValidation
 
struct  CNodeStateStats
 

Functions

bool GetNodeStateStats (NodeId nodeid, CNodeStateStats &stats)
 Get statistics from node state. More...
 
void Misbehaving (NodeId nodeid, int howmuch, const std::string &message="")
 Increase a node's misbehavior score. More...
 
bool IsBanned (NodeId nodeid)
 
void EraseObjectRequest (NodeId nodeId, const CInv &inv)
 
void RequestObject (NodeId nodeId, const CInv &inv, std::chrono::microseconds current_time, bool fForce=false)
 
size_t GetRequestedObjectCount (NodeId nodeId)
 

Variables

static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS_SIZE = 10
 Default for -maxorphantxsize, maximum size in megabytes the orphan map can grow before entries are removed. More...
 
static const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60
 Expiration time for orphan transactions in seconds. More...
 
static const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60
 Minimum time between orphan transactions expire time checks in seconds. More...
 
static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100
 Default number of orphan+recently-replaced txn to keep around for block reconstruction. More...
 
static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000
 Headers download timeout expressed in microseconds Timeout = base + per_header * (expected number of headers) More...
 
static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000
 
static constexpr int32_t MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT = 4
 Protect at least this many outbound peers from disconnection due to slow/ behind headers chain. More...
 
static constexpr int64_t CHAIN_SYNC_TIMEOUT = 20 * 60
 Timeout for (unprotected) outbound peers to sync to our chainwork, in seconds. More...
 
static constexpr int64_t STALE_CHECK_INTERVAL = 150
 How frequently to check for stale tips, in seconds. More...
 
static constexpr int64_t EXTRA_PEER_CHECK_INTERVAL = 45
 How frequently to check for extra outbound peers and disconnect, in seconds. More...
 
static constexpr int64_t MINIMUM_CONNECT_TIME = 30
 Minimum time an outbound-peer-eviction candidate must be connected for, in order to evict, in seconds. More...
 
static constexpr bool DEFAULT_ENABLE_BIP61 = true
 Default for BIP61 (sending reject messages) More...
 
bool g_enable_bip61
 Enable BIP61 (sending reject messages) More...
 

Function Documentation

◆ EraseObjectRequest()

void EraseObjectRequest ( NodeId  nodeId,
const CInv inv 
)

Definition at line 689 of file net_processing.cpp.

References AssertLockHeld(), cs_main, and EraseObjectRequest().

◆ GetNodeStateStats()

bool GetNodeStateStats ( NodeId  nodeid,
CNodeStateStats stats 
)

◆ GetRequestedObjectCount()

size_t GetRequestedObjectCount ( NodeId  nodeId)

Definition at line 807 of file net_processing.cpp.

References AssertLockHeld(), and cs_main.

Referenced by CGovernanceManager::RequestGovernanceObjectVotes().

◆ IsBanned()

bool IsBanned ( NodeId  nodeid)

◆ Misbehaving()

◆ RequestObject()

void RequestObject ( NodeId  nodeId,
const CInv inv,
std::chrono::microseconds  current_time,
bool  fForce = false 
)

Definition at line 797 of file net_processing.cpp.

References AssertLockHeld(), cs_main, and RequestObject().

Variable Documentation

◆ CHAIN_SYNC_TIMEOUT

constexpr int64_t CHAIN_SYNC_TIMEOUT = 20 * 60
static

Timeout for (unprotected) outbound peers to sync to our chainwork, in seconds.

Definition at line 31 of file net_processing.h.

Referenced by PeerLogicValidation::ConsiderEviction().

◆ DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN

const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100
static

Default number of orphan+recently-replaced txn to keep around for block reconstruction.

Definition at line 20 of file net_processing.h.

Referenced by AddToCompactExtraTransactions(), and HelpMessage().

◆ DEFAULT_ENABLE_BIP61

constexpr bool DEFAULT_ENABLE_BIP61 = true
static

Default for BIP61 (sending reject messages)

Definition at line 41 of file net_processing.h.

Referenced by AppInitParameterInteraction(), and HelpMessage().

◆ DEFAULT_MAX_ORPHAN_TRANSACTIONS_SIZE

const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS_SIZE = 10
static

Default for -maxorphantxsize, maximum size in megabytes the orphan map can grow before entries are removed.

Definition at line 14 of file net_processing.h.

Referenced by HelpMessage(), and ProcessMessage().

◆ EXTRA_PEER_CHECK_INTERVAL

constexpr int64_t EXTRA_PEER_CHECK_INTERVAL = 45
static

How frequently to check for extra outbound peers and disconnect, in seconds.

Definition at line 36 of file net_processing.h.

Referenced by PeerLogicValidation::PeerLogicValidation().

◆ g_enable_bip61

◆ HEADERS_DOWNLOAD_TIMEOUT_BASE

constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000
static

Headers download timeout expressed in microseconds Timeout = base + per_header * (expected number of headers)

Definition at line 24 of file net_processing.h.

Referenced by ProcessMessage(), and PeerLogicValidation::SendMessages().

◆ HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER

constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000
static

Definition at line 25 of file net_processing.h.

Referenced by ProcessMessage(), and PeerLogicValidation::SendMessages().

◆ MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT

constexpr int32_t MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT = 4
static

Protect at least this many outbound peers from disconnection due to slow/ behind headers chain.

Definition at line 29 of file net_processing.h.

◆ MINIMUM_CONNECT_TIME

constexpr int64_t MINIMUM_CONNECT_TIME = 30
static

Minimum time an outbound-peer-eviction candidate must be connected for, in order to evict, in seconds.

Definition at line 38 of file net_processing.h.

Referenced by PeerLogicValidation::EvictExtraOutboundPeers().

◆ ORPHAN_TX_EXPIRE_INTERVAL

const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60
static

Minimum time between orphan transactions expire time checks in seconds.

Definition at line 18 of file net_processing.h.

Referenced by LimitOrphanTxSize().

◆ ORPHAN_TX_EXPIRE_TIME

const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60
static

Expiration time for orphan transactions in seconds.

Definition at line 16 of file net_processing.h.

Referenced by AddOrphanTx(), and LimitOrphanTxSize().

◆ STALE_CHECK_INTERVAL

constexpr int64_t STALE_CHECK_INTERVAL = 150
static

How frequently to check for stale tips, in seconds.

Definition at line 34 of file net_processing.h.

Referenced by PeerLogicValidation::CheckForStaleTipAndEvictPeers(), and PeerLogicValidation::PeerLogicValidation().

Released under the MIT license