PIVX Core  5.6.99
P2P Digital Currency
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CConnman Class Referenceabstract

#include <net.h>

Collaboration diagram for CConnman:
[legend]

Classes

struct  CAllNodes
 
struct  CFullyConnectedOnly
 
struct  ListenSocket
 
struct  Options
 

Public Types

enum  NumConnections { CONNECTIONS_NONE = 0 , CONNECTIONS_IN = (1U << 0) , CONNECTIONS_OUT = (1U << 1) , CONNECTIONS_ALL = (CONNECTIONS_IN | CONNECTIONS_OUT) }
 

Public Member Functions

void Init (const Options &connOptions)
 
 CConnman (uint64_t seed0, uint64_t seed1)
 
 ~CConnman ()
 
bool Start (CScheduler &scheduler, const Options &options)
 
void Stop ()
 
void Interrupt ()
 
bool GetNetworkActive () const
 
void SetNetworkActive (bool active)
 
void OpenNetworkConnection (const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound=nullptr, const char *strDest=nullptr, bool fOneShot=false, bool fFeeler=false, bool fAddnode=false, bool masternode_connection=false, bool masternode_probe_connection=false)
 
bool CheckIncomingNonce (uint64_t nonce)
 
bool ForNode (NodeId id, std::function< bool(CNode *pnode)> func)
 
bool ForNode (const CService &addr, const std::function< bool(const CNode *pnode)> &cond, const std::function< bool(CNode *pnode)> &func)
 
void PushMessage (CNode *pnode, CSerializedNetMsg &&msg, bool allowOptimisticSend=DEFAULT_ALLOW_OPTIMISTIC_SEND)
 
template<typename Callable >
bool ForEachNodeContinueIf (Callable &&func)
 
template<typename Callable >
bool ForEachNodeInRandomOrderContinueIf (Callable &&func)
 
template<typename Callable >
void ForEachNode (Callable &&func)
 
template<typename Callable >
void ForEachNode (Callable &&func) const
 
template<typename Callable , typename CallableAfter >
void ForEachNodeThen (Callable &&pre, CallableAfter &&post)
 
template<typename Callable , typename CallableAfter >
void ForEachNodeThen (Callable &&pre, CallableAfter &&post) const
 
std::vector< CNode * > CopyNodeVector (std::function< bool(const CNode *pnode)> cond)
 
std::vector< CNode * > CopyNodeVector ()
 
void ReleaseNodeVector (const std::vector< CNode * > &vecNodes)
 
void RemoveAskFor (const uint256 &invHash, int invType)
 
void RelayInv (CInv &inv, int minProtoVersion=ActiveProtocol())
 
bool IsNodeConnected (const CAddress &addr)
 
CNodeConnectNode (const CAddress &addrConnect)
 
void SetServices (const CService &addr, ServiceFlags nServices)
 
void MarkAddressGood (const CAddress &addr)
 
void AddNewAddress (const CAddress &addr, const CAddress &addrFrom, int64_t nTimePenalty=0)
 
bool AddNewAddresses (const std::vector< CAddress > &vAddr, const CAddress &addrFrom, int64_t nTimePenalty=0)
 
std::vector< CAddressGetAddresses (size_t max_addresses, size_t max_pct, Optional< Network > network)
 Return all or many randomly selected addresses, optionally by network. More...
 
void Ban (const CNetAddr &netAddr, const BanReason &reason, int64_t bantimeoffset=0, bool sinceUnixEpoch=false)
 
void Ban (const CSubNet &subNet, const BanReason &reason, int64_t bantimeoffset=0, bool sinceUnixEpoch=false)
 
void ClearBanned ()
 
bool IsBanned (CNetAddr ip)
 
bool IsBanned (CSubNet subnet)
 
bool Unban (const CNetAddr &ip)
 
bool Unban (const CSubNet &ip)
 
void GetBanned (banmap_t &banmap)
 
void SetBanned (const banmap_t &banmap)
 
bool AddNode (const std::string &node)
 
bool RemoveAddedNode (const std::string &node)
 
std::vector< AddedNodeInfoGetAddedNodeInfo ()
 
size_t GetNodeCount (NumConnections num)
 
size_t GetMaxOutboundNodeCount ()
 
void GetNodeStats (std::vector< CNodeStats > &vstats)
 
bool DisconnectNode (const std::string &node)
 
bool DisconnectNode (NodeId id)
 
unsigned int GetSendBufferSize () const
 
ServiceFlags GetLocalServices () const
 
uint64_t GetTotalBytesRecv ()
 
uint64_t GetTotalBytesSent ()
 
void SetBestHeight (int height)
 
int GetBestHeight () const
 
CSipHasher GetDeterministicRandomizer (uint64_t id)
 Get a unique deterministic randomizer. More...
 
unsigned int GetReceiveFloodSize () const
 
void SetAsmap (std::vector< bool > asmap)
 
TierTwoConnManGetTierTwoConnMan ()
 Unique tier two connections manager. More...
 
void UpdateQuorumRelayMemberIfNeeded (CNode *pnode)
 Update the node to be a iqr member if needed. More...
 
void WakeSelect ()
 Interrupt the select/poll system call. More...
 

Static Public Attributes

constexpr static const CFullyConnectedOnly FullyConnectedOnly {}
 
constexpr static const CAllNodes AllNodes {}
 

Private Member Functions

bool BindListenPort (const CService &bindAddr, std::string &strError, bool fWhitelisted=false)
 
bool Bind (const CService &addr, unsigned int flags)
 
bool InitBinds (const std::vector< CService > &binds, const std::vector< CService > &whiteBinds)
 
void ThreadOpenAddedConnections ()
 
void AddOneShot (const std::string &strDest)
 
void ProcessOneShot ()
 
void ThreadOpenConnections (const std::vector< std::string > connect)
 
void ThreadMessageHandler ()
 
void AcceptConnection (const ListenSocket &hListenSocket)
 
void DisconnectNodes ()
 
void NotifyNumConnectionsChanged ()
 
void InactivityCheck (CNode *pnode)
 
bool GenerateSelectSet (std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set)
 
void SocketEvents (std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set)
 
void SocketHandler ()
 
void ThreadSocketHandler ()
 
void ThreadDNSAddressSeed ()
 
void WakeMessageHandler ()
 
uint64_t CalculateKeyedNetGroup (const CAddress &ad)
 
CNodeFindNode (const CNetAddr &ip)
 
CNodeFindNode (const CSubNet &subNet)
 
CNodeFindNode (const std::string &addrName)
 
CNodeFindNode (const CService &addr)
 
bool AttemptToEvictConnection (bool fPreferNewConnection)
 Try to find a connection to evict when the node is full. More...
 
CNodeConnectNode (CAddress addrConnect, const char *pszDest, bool fCountFailure, bool manual_connection)
 
bool IsWhitelistedRange (const CNetAddr &addr)
 
void DeleteNode (CNode *pnode)
 
NodeId GetNewNodeId ()
 
size_t SocketSendData (CNode *pnode)
 
bool BannedSetIsDirty ()
 check is the banlist has unwritten changes More...
 
void SetBannedSetDirty (bool dirty=true)
 set the "dirty" flag for the banlist More...
 
void SweepBanned ()
 clean unused entries (if bantime has expired) More...
 
void DumpAddresses ()
 
void DumpData ()
 
void DumpBanlist ()
 
void RecordBytesRecv (uint64_t bytes)
 
void RecordBytesSent (uint64_t bytes)
 
uint64_t nTotalBytesRecv GUARDED_BY (cs_totalBytesRecv)=0
 
uint64_t nTotalBytesSent GUARDED_BY (cs_totalBytesSent)=0
 
std::vector< std::string > vAddedNodes GUARDED_BY (cs_vAddedNodes)
 

Static Private Member Functions

static bool NodeFullyConnected (const CNode *pnode)
 

Private Attributes

RecursiveMutex cs_totalBytesRecv
 
RecursiveMutex cs_totalBytesSent
 
std::vector< CSubNetvWhitelistedRange
 
unsigned int nSendBufferMaxSize {0}
 
unsigned int nReceiveFloodSize {0}
 
std::vector< ListenSocketvhListenSocket
 
std::atomic< bool > fNetworkActive {true}
 
banmap_t setBanned
 
RecursiveMutex cs_setBanned
 
bool setBannedIsDirty {false}
 
bool fAddressesInitialized {false}
 
CAddrMan addrman
 
std::deque< std::string > vOneShots
 
RecursiveMutex cs_vOneShots
 
RecursiveMutex cs_vAddedNodes
 
std::vector< CNode * > vNodes
 
std::list< CNode * > vNodesDisconnected
 
RecursiveMutex cs_vNodes
 
std::atomic< NodeIdnLastNodeId
 
unsigned int nPrevNodeCount
 
ServiceFlags nLocalServices {NODE_NONE}
 Services this instance offers. More...
 
ServiceFlags nRelevantServices {NODE_NONE}
 Services this instance cares about. More...
 
std::unique_ptr< CSemaphoresemOutbound
 
std::unique_ptr< CSemaphoresemAddnode
 
int nMaxConnections {0}
 
int nMaxOutbound {0}
 
int nMaxAddnode
 
int nMaxFeeler {0}
 
std::atomic< int > nBestHeight
 
CClientUIInterfaceclientInterface {nullptr}
 
NetEventsInterfacem_msgproc {nullptr}
 
const uint64_t nSeed0 {0}
 SipHasher seeds for deterministic randomness. More...
 
const uint64_t nSeed1 {0}
 
bool fMsgProcWake {false}
 flag for waking the message processor. More...
 
std::condition_variable condMsgProc
 
std::mutex mutexMsgProc
 
std::atomic< bool > flagInterruptMsgProc
 
CThreadInterrupt interruptNet
 
int wakeupPipe [2] {-1, -1}
 a pipe which is added to select() calls to wakeup before the timeout More...
 
std::atomic< bool > wakeupSelectNeeded {false}
 
std::thread threadDNSAddressSeed
 
std::thread threadSocketHandler
 
std::thread threadOpenAddedConnections
 
std::thread threadOpenConnections
 
std::thread threadMessageHandler
 
std::unique_ptr< TierTwoConnManm_tiertwo_conn_man
 

Detailed Description

Definition at line 144 of file net.h.

Member Enumeration Documentation

◆ NumConnections

Enumerator
CONNECTIONS_NONE 
CONNECTIONS_IN 
CONNECTIONS_OUT 
CONNECTIONS_ALL 

Definition at line 148 of file net.h.

Constructor & Destructor Documentation

◆ CConnman()

CConnman::CConnman ( uint64_t  seed0,
uint64_t  seed1 
)

Definition at line 2157 of file net.cpp.

Here is the call graph for this function:

◆ ~CConnman()

CConnman::~CConnman ( )

Definition at line 2459 of file net.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AcceptConnection()

void CConnman::AcceptConnection ( const ListenSocket hListenSocket)
private
Todo:
: pending review.

Definition at line 1074 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddNewAddress()

void CConnman::AddNewAddress ( const CAddress addr,
const CAddress addrFrom,
int64_t  nTimePenalty = 0 
)

Definition at line 2475 of file net.cpp.

Here is the call graph for this function:

◆ AddNewAddresses()

bool CConnman::AddNewAddresses ( const std::vector< CAddress > &  vAddr,
const CAddress addrFrom,
int64_t  nTimePenalty = 0 
)

Definition at line 2480 of file net.cpp.

Here is the call graph for this function:

◆ AddNode()

bool CConnman::AddNode ( const std::string &  node)

Definition at line 2490 of file net.cpp.

◆ AddOneShot()

void CConnman::AddOneShot ( const std::string &  strDest)
private

Definition at line 98 of file net.cpp.

Here is the caller graph for this function:

◆ AttemptToEvictConnection()

bool CConnman::AttemptToEvictConnection ( bool  fPreferNewConnection)
private

Try to find a connection to evict when the node is full.

Extreme care must be taken to avoid opening the node to attacker triggered network partitioning. The strategy used here is to protect a small number of peers for each of several distinct characteristics which are difficult to forge. In order to partition a node the attacker must be simultaneously better at all of them than honest peers.

Definition at line 972 of file net.cpp.

Here is the call graph for this function:

◆ Ban() [1/2]

void CConnman::Ban ( const CNetAddr netAddr,
const BanReason reason,
int64_t  bantimeoffset = 0,
bool  sinceUnixEpoch = false 
)

Definition at line 512 of file net.cpp.

◆ Ban() [2/2]

void CConnman::Ban ( const CSubNet subNet,
const BanReason reason,
int64_t  bantimeoffset = 0,
bool  sinceUnixEpoch = false 
)

Definition at line 518 of file net.cpp.

Here is the call graph for this function:

◆ BannedSetIsDirty()

bool CConnman::BannedSetIsDirty ( )
private

check is the banlist has unwritten changes

Definition at line 615 of file net.cpp.

Here is the caller graph for this function:

◆ Bind()

bool CConnman::Bind ( const CService addr,
unsigned int  flags 
)
private

Definition at line 2178 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BindListenPort()

bool CConnman::BindListenPort ( const CService bindAddr,
std::string &  strError,
bool  fWhitelisted = false 
)
private

Definition at line 2034 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalculateKeyedNetGroup()

uint64_t CConnman::CalculateKeyedNetGroup ( const CAddress ad)
private

Definition at line 2882 of file net.cpp.

Here is the call graph for this function:

◆ CheckIncomingNonce()

bool CConnman::CheckIncomingNonce ( uint64_t  nonce)

Definition at line 334 of file net.cpp.

◆ ClearBanned()

void CConnman::ClearBanned ( )

Definition at line 473 of file net.cpp.

Here is the call graph for this function:

◆ ConnectNode() [1/2]

CNode * CConnman::ConnectNode ( CAddress  addrConnect,
const char *  pszDest,
bool  fCountFailure,
bool  manual_connection 
)
private

debug print

Definition at line 344 of file net.cpp.

Here is the call graph for this function:

◆ ConnectNode() [2/2]

CNode * CConnman::ConnectNode ( const CAddress addrConnect)

Definition at line 2830 of file net.cpp.

Here is the caller graph for this function:

◆ CopyNodeVector() [1/2]

std::vector< CNode * > CConnman::CopyNodeVector ( )

Definition at line 2864 of file net.cpp.

Here is the caller graph for this function:

◆ CopyNodeVector() [2/2]

std::vector< CNode * > CConnman::CopyNodeVector ( std::function< bool(const CNode *pnode)>  cond)

Definition at line 2850 of file net.cpp.

Here is the call graph for this function:

◆ DeleteNode()

void CConnman::DeleteNode ( CNode pnode)
private

Definition at line 2448 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DisconnectNode() [1/2]

bool CConnman::DisconnectNode ( const std::string &  node)

Definition at line 2545 of file net.cpp.

Here is the call graph for this function:

◆ DisconnectNode() [2/2]

bool CConnman::DisconnectNode ( NodeId  id)

Definition at line 2555 of file net.cpp.

◆ DisconnectNodes()

void CConnman::DisconnectNodes ( )
private

Definition at line 1164 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpAddresses()

void CConnman::DumpAddresses ( )
private

Definition at line 1667 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpBanlist()

void CConnman::DumpBanlist ( )
private

Definition at line 433 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpData()

void CConnman::DumpData ( )
private

Definition at line 1678 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindNode() [1/4]

CNode * CConnman::FindNode ( const CNetAddr ip)
private

Definition at line 284 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindNode() [2/4]

CNode * CConnman::FindNode ( const CService addr)
private

Definition at line 317 of file net.cpp.

Here is the call graph for this function:

◆ FindNode() [3/4]

CNode * CConnman::FindNode ( const CSubNet subNet)
private

Definition at line 295 of file net.cpp.

Here is the call graph for this function:

◆ FindNode() [4/4]

CNode * CConnman::FindNode ( const std::string &  addrName)
private

Definition at line 306 of file net.cpp.

◆ ForEachNode() [1/2]

template<typename Callable >
void CConnman::ForEachNode ( Callable &&  func)
inline

Definition at line 257 of file net.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ForEachNode() [2/2]

template<typename Callable >
void CConnman::ForEachNode ( Callable &&  func) const
inline

Definition at line 267 of file net.h.

Here is the call graph for this function:

◆ ForEachNodeContinueIf()

template<typename Callable >
bool CConnman::ForEachNodeContinueIf ( Callable &&  func)
inline

Definition at line 230 of file net.h.

Here is the call graph for this function:

◆ ForEachNodeInRandomOrderContinueIf()

template<typename Callable >
bool CConnman::ForEachNodeInRandomOrderContinueIf ( Callable &&  func)
inline

Definition at line 242 of file net.h.

◆ ForEachNodeThen() [1/2]

template<typename Callable , typename CallableAfter >
void CConnman::ForEachNodeThen ( Callable &&  pre,
CallableAfter &&  post 
)
inline

Definition at line 277 of file net.h.

Here is the call graph for this function:

◆ ForEachNodeThen() [2/2]

template<typename Callable , typename CallableAfter >
void CConnman::ForEachNodeThen ( Callable &&  pre,
CallableAfter &&  post 
) const
inline

Definition at line 288 of file net.h.

Here is the call graph for this function:

◆ ForNode() [1/2]

bool CConnman::ForNode ( const CService addr,
const std::function< bool(const CNode *pnode)> &  cond,
const std::function< bool(CNode *pnode)> &  func 
)

Definition at line 2812 of file net.cpp.

◆ ForNode() [2/2]

bool CConnman::ForNode ( NodeId  id,
std::function< bool(CNode *pnode)>  func 
)

Definition at line 2799 of file net.cpp.

Here is the call graph for this function:

◆ GenerateSelectSet()

bool CConnman::GenerateSelectSet ( std::set< SOCKET > &  recv_set,
std::set< SOCKET > &  send_set,
std::set< SOCKET > &  error_set 
)
private

Definition at line 1260 of file net.cpp.

Here is the caller graph for this function:

◆ GetAddedNodeInfo()

std::vector< AddedNodeInfo > CConnman::GetAddedNodeInfo ( )

Definition at line 1856 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAddresses()

std::vector< CAddress > CConnman::GetAddresses ( size_t  max_addresses,
size_t  max_pct,
Optional< Network network 
)

Return all or many randomly selected addresses, optionally by network.

Parameters
[in]max_addressesMaximum number of addresses to return (0 = all).
[in]max_pctMaximum percentage of addresses to return (0 = all).
[in]networkSelect only addresses of this network (nullopt = all).

Definition at line 2485 of file net.cpp.

Here is the call graph for this function:

◆ GetBanned()

void CConnman::GetBanned ( banmap_t banmap)

Definition at line 571 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBestHeight()

int CConnman::GetBestHeight ( ) const

Definition at line 2631 of file net.cpp.

◆ GetDeterministicRandomizer()

CSipHasher CConnman::GetDeterministicRandomizer ( uint64_t  id)

Get a unique deterministic randomizer.

Definition at line 2877 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLocalServices()

ServiceFlags CConnman::GetLocalServices ( ) const

Definition at line 2621 of file net.cpp.

◆ GetMaxOutboundNodeCount()

size_t CConnman::GetMaxOutboundNodeCount ( )

Definition at line 2513 of file net.cpp.

◆ GetNetworkActive()

bool CConnman::GetNetworkActive ( ) const
inline

Definition at line 200 of file net.h.

◆ GetNewNodeId()

NodeId CConnman::GetNewNodeId ( )
private

Definition at line 2173 of file net.cpp.

◆ GetNodeCount()

size_t CConnman::GetNodeCount ( NumConnections  num)

Definition at line 2518 of file net.cpp.

◆ GetNodeStats()

void CConnman::GetNodeStats ( std::vector< CNodeStats > &  vstats)

Definition at line 2534 of file net.cpp.

◆ GetReceiveFloodSize()

unsigned int CConnman::GetReceiveFloodSize ( ) const

Definition at line 2636 of file net.cpp.

◆ GetSendBufferSize()

unsigned int CConnman::GetSendBufferSize ( ) const

Definition at line 2637 of file net.cpp.

◆ GetTierTwoConnMan()

TierTwoConnMan* CConnman::GetTierTwoConnMan ( )
inline

Unique tier two connections manager.

Definition at line 375 of file net.h.

◆ GetTotalBytesRecv()

uint64_t CConnman::GetTotalBytesRecv ( )

Definition at line 2609 of file net.cpp.

◆ GetTotalBytesSent()

uint64_t CConnman::GetTotalBytesSent ( )

Definition at line 2615 of file net.cpp.

◆ GUARDED_BY() [1/3]

uint64_t nTotalBytesRecv CConnman::GUARDED_BY ( cs_totalBytesRecv  )
privatepure virtual

◆ GUARDED_BY() [2/3]

uint64_t nTotalBytesSent CConnman::GUARDED_BY ( cs_totalBytesSent  )
privatepure virtual

◆ GUARDED_BY() [3/3]

std::vector<std::string> vAddedNodes CConnman::GUARDED_BY ( cs_vAddedNodes  )
private

◆ InactivityCheck()

void CConnman::InactivityCheck ( CNode pnode)
private

Definition at line 1237 of file net.cpp.

Here is the call graph for this function:

◆ Init()

void CConnman::Init ( const Options connOptions)
inline

Definition at line 177 of file net.h.

Here is the caller graph for this function:

◆ InitBinds()

bool CConnman::InitBinds ( const std::vector< CService > &  binds,
const std::vector< CService > &  whiteBinds 
)
private

Definition at line 2191 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Interrupt()

void CConnman::Interrupt ( )

Definition at line 2375 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsBanned() [1/2]

bool CConnman::IsBanned ( CNetAddr  ip)

Definition at line 485 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsBanned() [2/2]

bool CConnman::IsBanned ( CSubNet  subnet)

Definition at line 499 of file net.cpp.

Here is the call graph for this function:

◆ IsNodeConnected()

bool CConnman::IsNodeConnected ( const CAddress addr)

Definition at line 2825 of file net.cpp.

Here is the call graph for this function:

◆ IsWhitelistedRange()

bool CConnman::IsWhitelistedRange ( const CNetAddr addr)
private

Definition at line 628 of file net.cpp.

◆ MarkAddressGood()

void CConnman::MarkAddressGood ( const CAddress addr)

Definition at line 2470 of file net.cpp.

Here is the call graph for this function:

◆ NodeFullyConnected()

bool CConnman::NodeFullyConnected ( const CNode pnode)
staticprivate

Definition at line 2753 of file net.cpp.

Here is the caller graph for this function:

◆ NotifyNumConnectionsChanged()

void CConnman::NotifyNumConnectionsChanged ( )
private

Definition at line 1223 of file net.cpp.

Here is the caller graph for this function:

◆ OpenNetworkConnection()

void CConnman::OpenNetworkConnection ( const CAddress addrConnect,
bool  fCountFailure,
CSemaphoreGrant grantOutbound = nullptr,
const char *  strDest = nullptr,
bool  fOneShot = false,
bool  fFeeler = false,
bool  fAddnode = false,
bool  masternode_connection = false,
bool  masternode_probe_connection = false 
)

Definition at line 1937 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessOneShot()

void CConnman::ProcessOneShot ( )
private

Definition at line 1684 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushMessage()

void CConnman::PushMessage ( CNode pnode,
CSerializedNetMsg &&  msg,
bool  allowOptimisticSend = DEFAULT_ALLOW_OPTIMISTIC_SEND 
)

Definition at line 2758 of file net.cpp.

Here is the call graph for this function:

◆ RecordBytesRecv()

void CConnman::RecordBytesRecv ( uint64_t  bytes)
private

Definition at line 2597 of file net.cpp.

Here is the caller graph for this function:

◆ RecordBytesSent()

void CConnman::RecordBytesSent ( uint64_t  bytes)
private

Definition at line 2603 of file net.cpp.

◆ RelayInv()

void CConnman::RelayInv ( CInv inv,
int  minProtoVersion = ActiveProtocol() 
)

Definition at line 2567 of file net.cpp.

Here is the call graph for this function:

◆ ReleaseNodeVector()

void CConnman::ReleaseNodeVector ( const std::vector< CNode * > &  vecNodes)

Definition at line 2869 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveAddedNode()

bool CConnman::RemoveAddedNode ( const std::string &  node)

Definition at line 2501 of file net.cpp.

◆ RemoveAskFor()

void CConnman::RemoveAskFor ( const uint256 invHash,
int  invType 
)

Definition at line 2579 of file net.cpp.

Here is the caller graph for this function:

◆ SetAsmap()

void CConnman::SetAsmap ( std::vector< bool >  asmap)
inline

Definition at line 373 of file net.h.

◆ SetBanned()

void CConnman::SetBanned ( const banmap_t banmap)

Definition at line 579 of file net.cpp.

◆ SetBannedSetDirty()

void CConnman::SetBannedSetDirty ( bool  dirty = true)
private

set the "dirty" flag for the banlist

Definition at line 621 of file net.cpp.

Here is the caller graph for this function:

◆ SetBestHeight()

void CConnman::SetBestHeight ( int  height)

Definition at line 2626 of file net.cpp.

Here is the caller graph for this function:

◆ SetNetworkActive()

void CConnman::SetNetworkActive ( bool  active)

Definition at line 2144 of file net.cpp.

◆ SetServices()

void CConnman::SetServices ( const CService addr,
ServiceFlags  nServices 
)

Definition at line 2465 of file net.cpp.

Here is the call graph for this function:

◆ SocketEvents()

void CConnman::SocketEvents ( std::set< SOCKET > &  recv_set,
std::set< SOCKET > &  send_set,
std::set< SOCKET > &  error_set 
)
private

Definition at line 1362 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SocketHandler()

void CConnman::SocketHandler ( )
private

Definition at line 1438 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SocketSendData()

size_t CConnman::SocketSendData ( CNode pnode)
private

Definition at line 857 of file net.cpp.

◆ Start()

bool CConnman::Start ( CScheduler scheduler,
const Options options 
)

Definition at line 2208 of file net.cpp.

Here is the call graph for this function:

◆ Stop()

void CConnman::Stop ( )

Definition at line 2400 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SweepBanned()

void CConnman::SweepBanned ( )
private

clean unused entries (if bantime has expired)

Definition at line 586 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ThreadDNSAddressSeed()

void CConnman::ThreadDNSAddressSeed ( )
private

Definition at line 1601 of file net.cpp.

Here is the call graph for this function:

◆ ThreadMessageHandler()

void CConnman::ThreadMessageHandler ( )
private

Definition at line 1987 of file net.cpp.

Here is the call graph for this function:

◆ ThreadOpenAddedConnections()

void CConnman::ThreadOpenAddedConnections ( )
private

Definition at line 1910 of file net.cpp.

Here is the call graph for this function:

◆ ThreadOpenConnections()

void CConnman::ThreadOpenConnections ( const std::vector< std::string >  connect)
private

Definition at line 1701 of file net.cpp.

Here is the call graph for this function:

◆ ThreadSocketHandler()

void CConnman::ThreadSocketHandler ( )
private

Definition at line 1553 of file net.cpp.

Here is the call graph for this function:

◆ Unban() [1/2]

bool CConnman::Unban ( const CNetAddr ip)

Definition at line 551 of file net.cpp.

◆ Unban() [2/2]

bool CConnman::Unban ( const CSubNet ip)

Definition at line 557 of file net.cpp.

Here is the call graph for this function:

◆ UpdateQuorumRelayMemberIfNeeded()

void CConnman::UpdateQuorumRelayMemberIfNeeded ( CNode pnode)

Update the node to be a iqr member if needed.

Definition at line 2589 of file net.cpp.

◆ WakeMessageHandler()

void CConnman::WakeMessageHandler ( )
private

Definition at line 1562 of file net.cpp.

Here is the caller graph for this function:

◆ WakeSelect()

void CConnman::WakeSelect ( )

Interrupt the select/poll system call.

Definition at line 1571 of file net.cpp.

Member Data Documentation

◆ addrman

CAddrMan CConnman::addrman
private

Definition at line 461 of file net.h.

◆ AllNodes

constexpr const CConnman::CAllNodes CConnman::AllNodes {}
staticconstexpr

Definition at line 222 of file net.h.

◆ clientInterface

CClientUIInterface* CConnman::clientInterface {nullptr}
private

Definition at line 485 of file net.h.

◆ condMsgProc

std::condition_variable CConnman::condMsgProc
private

Definition at line 494 of file net.h.

◆ cs_setBanned

RecursiveMutex CConnman::cs_setBanned
private

Definition at line 458 of file net.h.

◆ cs_totalBytesRecv

RecursiveMutex CConnman::cs_totalBytesRecv
private

Definition at line 443 of file net.h.

◆ cs_totalBytesSent

RecursiveMutex CConnman::cs_totalBytesSent
private

Definition at line 444 of file net.h.

◆ cs_vAddedNodes

RecursiveMutex CConnman::cs_vAddedNodes
private

Definition at line 465 of file net.h.

◆ cs_vNodes

RecursiveMutex CConnman::cs_vNodes
mutableprivate

Definition at line 468 of file net.h.

◆ cs_vOneShots

RecursiveMutex CConnman::cs_vOneShots
private

Definition at line 463 of file net.h.

◆ fAddressesInitialized

bool CConnman::fAddressesInitialized {false}
private

Definition at line 460 of file net.h.

◆ flagInterruptMsgProc

std::atomic<bool> CConnman::flagInterruptMsgProc
private

Definition at line 496 of file net.h.

◆ fMsgProcWake

bool CConnman::fMsgProcWake {false}
private

flag for waking the message processor.

Definition at line 492 of file net.h.

◆ fNetworkActive

std::atomic<bool> CConnman::fNetworkActive {true}
private

Definition at line 456 of file net.h.

◆ FullyConnectedOnly

constexpr const CConnman::CFullyConnectedOnly CConnman::FullyConnectedOnly {}
staticconstexpr

Definition at line 221 of file net.h.

◆ interruptNet

CThreadInterrupt CConnman::interruptNet
private

Definition at line 498 of file net.h.

◆ m_msgproc

NetEventsInterface* CConnman::m_msgproc {nullptr}
private

Definition at line 486 of file net.h.

◆ m_tiertwo_conn_man

std::unique_ptr<TierTwoConnMan> CConnman::m_tiertwo_conn_man
private

Definition at line 512 of file net.h.

◆ mutexMsgProc

std::mutex CConnman::mutexMsgProc
private

Definition at line 495 of file net.h.

◆ nBestHeight

std::atomic<int> CConnman::nBestHeight
private

Definition at line 484 of file net.h.

◆ nLastNodeId

std::atomic<NodeId> CConnman::nLastNodeId
private

Definition at line 469 of file net.h.

◆ nLocalServices

ServiceFlags CConnman::nLocalServices {NODE_NONE}
private

Services this instance offers.

Definition at line 473 of file net.h.

◆ nMaxAddnode

int CConnman::nMaxAddnode
private

Definition at line 482 of file net.h.

◆ nMaxConnections

int CConnman::nMaxConnections {0}
private

Definition at line 480 of file net.h.

◆ nMaxFeeler

int CConnman::nMaxFeeler {0}
private

Definition at line 483 of file net.h.

◆ nMaxOutbound

int CConnman::nMaxOutbound {0}
private

Definition at line 481 of file net.h.

◆ nPrevNodeCount

unsigned int CConnman::nPrevNodeCount
private

Definition at line 470 of file net.h.

◆ nReceiveFloodSize

unsigned int CConnman::nReceiveFloodSize {0}
private

Definition at line 453 of file net.h.

◆ nRelevantServices

ServiceFlags CConnman::nRelevantServices {NODE_NONE}
private

Services this instance cares about.

Definition at line 476 of file net.h.

◆ nSeed0

const uint64_t CConnman::nSeed0 {0}
private

SipHasher seeds for deterministic randomness.

Definition at line 489 of file net.h.

◆ nSeed1

const uint64_t CConnman::nSeed1 {0}
private

Definition at line 489 of file net.h.

◆ nSendBufferMaxSize

unsigned int CConnman::nSendBufferMaxSize {0}
private

Definition at line 452 of file net.h.

◆ semAddnode

std::unique_ptr<CSemaphore> CConnman::semAddnode
private

Definition at line 479 of file net.h.

◆ semOutbound

std::unique_ptr<CSemaphore> CConnman::semOutbound
private

Definition at line 478 of file net.h.

◆ setBanned

banmap_t CConnman::setBanned
private

Definition at line 457 of file net.h.

◆ setBannedIsDirty

bool CConnman::setBannedIsDirty {false}
private

Definition at line 459 of file net.h.

◆ threadDNSAddressSeed

std::thread CConnman::threadDNSAddressSeed
private

Definition at line 506 of file net.h.

◆ threadMessageHandler

std::thread CConnman::threadMessageHandler
private

Definition at line 510 of file net.h.

◆ threadOpenAddedConnections

std::thread CConnman::threadOpenAddedConnections
private

Definition at line 508 of file net.h.

◆ threadOpenConnections

std::thread CConnman::threadOpenConnections
private

Definition at line 509 of file net.h.

◆ threadSocketHandler

std::thread CConnman::threadSocketHandler
private

Definition at line 507 of file net.h.

◆ vhListenSocket

std::vector<ListenSocket> CConnman::vhListenSocket
private

Definition at line 455 of file net.h.

◆ vNodes

std::vector<CNode*> CConnman::vNodes
private

Definition at line 466 of file net.h.

◆ vNodesDisconnected

std::list<CNode*> CConnman::vNodesDisconnected
private

Definition at line 467 of file net.h.

◆ vOneShots

std::deque<std::string> CConnman::vOneShots
private

Definition at line 462 of file net.h.

◆ vWhitelistedRange

std::vector<CSubNet> CConnman::vWhitelistedRange
private

Definition at line 450 of file net.h.

◆ wakeupPipe

int CConnman::wakeupPipe[2] {-1, -1}
private

a pipe which is added to select() calls to wakeup before the timeout

Definition at line 502 of file net.h.

◆ wakeupSelectNeeded

std::atomic<bool> CConnman::wakeupSelectNeeded {false}
private

Definition at line 504 of file net.h.


The documentation for this class was generated from the following files: