Dash Core  0.12.2.1
P2P Digital Currency
net_processing.cpp File Reference
#include "net_processing.h"
#include "alert.h"
#include "addrman.h"
#include "arith_uint256.h"
#include "chainparams.h"
#include "consensus/validation.h"
#include "hash.h"
#include "init.h"
#include "validation.h"
#include "merkleblock.h"
#include "net.h"
#include "netbase.h"
#include "policy/fees.h"
#include "policy/policy.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "random.h"
#include "tinyformat.h"
#include "txmempool.h"
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#include "utilstrencodings.h"
#include "validationinterface.h"
#include "spork.h"
#include "governance.h"
#include "instantx.h"
#include "masternode-payments.h"
#include "masternode-sync.h"
#include "masternodeman.h"
#include "privatesend-client.h"
#include "privatesend-server.h"
#include <boost/thread.hpp>

Go to the source code of this file.

Classes

struct  COrphanTx
 
class  CNetProcessingCleanup
 

Functions

map< uint256, COrphanTx > mapOrphanTransactions GUARDED_BY (cs_main)
 
void EraseOrphansFor (NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
bool GetNodeStateStats (NodeId nodeid, CNodeStateStats &stats)
 
void RegisterNodeSignals (CNodeSignals &nodeSignals)
 
void UnregisterNodeSignals (CNodeSignals &nodeSignals)
 
bool AddOrphanTx (const CTransaction &tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
static void EraseOrphanTx (uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
unsigned int LimitOrphanTxSize (unsigned int nMaxOrphans) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
void Misbehaving (NodeId pnode, int howmuch)
 
static bool AlreadyHave (const CInv &inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
static void RelayAddress (const CAddress &addr, bool fReachable, CConnman &connman)
 
static void ProcessGetData (CNode *pfrom, const Consensus::Params &consensusParams, CConnman &connman, std::atomic< bool > &interruptMsgProc)
 
static bool ProcessMessage (CNode *pfrom, string strCommand, CDataStream &vRecv, int64_t nTimeReceived, CConnman &connman, std::atomic< bool > &interruptMsgProc)
 
bool ProcessMessages (CNode *pfrom, CConnman &connman, std::atomic< bool > &interruptMsgProc)
 
bool SendMessages (CNode *pto, CConnman &connman, std::atomic< bool > &interruptMsgProc)
 

Variables

int64_t nTimeBestReceived = 0
 
class CNetProcessingCleanup instance_of_cnetprocessingcleanup
 

Function Documentation

◆ AddOrphanTx()

bool AddOrphanTx ( const CTransaction tx,
NodeId  peer 
)

Definition at line 504 of file net_processing.cpp.

Referenced by ProcessMessage().

◆ AlreadyHave()

static bool AlreadyHave ( const CInv inv)
static

Definition at line 677 of file net_processing.cpp.

Referenced by ProcessMessage(), and SendMessages().

◆ EraseOrphansFor()

void EraseOrphansFor ( NodeId  peer)

Definition at line 551 of file net_processing.cpp.

◆ EraseOrphanTx()

static void EraseOrphanTx ( uint256  hash)
static

Definition at line 534 of file net_processing.cpp.

Referenced by EraseOrphansFor(), LimitOrphanTxSize(), and ProcessMessage().

◆ GetNodeStateStats()

bool GetNodeStateStats ( NodeId  nodeid,
CNodeStateStats stats 
)

Get statistics from node state

Definition at line 468 of file net_processing.cpp.

Referenced by getpeerinfo(), and PeerTablePriv::refreshPeers().

◆ GUARDED_BY()

map< uint256, set< uint256 > > mapOrphanTransactionsByPrev GUARDED_BY ( cs_main  )

◆ LimitOrphanTxSize()

unsigned int LimitOrphanTxSize ( unsigned int  nMaxOrphans)

Definition at line 568 of file net_processing.cpp.

Referenced by ProcessMessage().

◆ Misbehaving()

◆ ProcessGetData()

static void ProcessGetData ( CNode pfrom,
const Consensus::Params consensusParams,
CConnman connman,
std::atomic< bool > &  interruptMsgProc 
)
static

Definition at line 785 of file net_processing.cpp.

Referenced by ProcessMessage(), and ProcessMessages().

◆ ProcessMessage()

static bool ProcessMessage ( CNode pfrom,
string  strCommand,
CDataStream vRecv,
int64_t  nTimeReceived,
CConnman connman,
std::atomic< bool > &  interruptMsgProc 
)
static

Definition at line 1074 of file net_processing.cpp.

Referenced by ProcessMessages().

◆ ProcessMessages()

bool ProcessMessages ( CNode pfrom,
CConnman connman,
std::atomic< bool > &  interrupt 
)

Process protocol messages received from a given node

Definition at line 2184 of file net_processing.cpp.

Referenced by RegisterNodeSignals(), and UnregisterNodeSignals().

◆ RegisterNodeSignals()

void RegisterNodeSignals ( CNodeSignals nodeSignals)

Register with a network node to receive its signals

Definition at line 483 of file net_processing.cpp.

Referenced by AppInit2().

◆ RelayAddress()

static void RelayAddress ( const CAddress addr,
bool  fReachable,
CConnman connman 
)
static

Definition at line 752 of file net_processing.cpp.

Referenced by ProcessMessage().

◆ SendMessages()

bool SendMessages ( CNode pto,
CConnman connman,
std::atomic< bool > &  interrupt 
)

Send queued protocol messages to be sent to a give node.

Parameters
[in]ptoThe node which we are sending messages to.
[in]connmanThe connection manager for that node.
[in]interruptInterrupt condition for processing threads
Returns
True if there is more work to be done

Definition at line 2296 of file net_processing.cpp.

Referenced by RegisterNodeSignals(), and UnregisterNodeSignals().

◆ UnregisterNodeSignals()

void UnregisterNodeSignals ( CNodeSignals nodeSignals)

Unregister a network node

Definition at line 491 of file net_processing.cpp.

Referenced by PrepareShutdown().

Variable Documentation

◆ instance_of_cnetprocessingcleanup

class CNetProcessingCleanup instance_of_cnetprocessingcleanup

◆ nTimeBestReceived

int64_t nTimeBestReceived = 0

Definition at line 49 of file net_processing.cpp.

Referenced by SendMessages().