Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

#include <net.h>

+ Collaboration diagram for CConnman:

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) }
 
enum  SocketEventsMode { SOCKETEVENTS_SELECT = 0, SOCKETEVENTS_POLL = 1, SOCKETEVENTS_EPOLL = 2 }
 

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)
 
SocketEventsMode GetSocketEventsMode () const
 
void OpenNetworkConnection (const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound=nullptr, const char *strDest=nullptr, bool fOneShot=false, bool fFeeler=false, bool manual_connection=false, bool fConnectToMasternode=false, bool fMasternodeProbe=false)
 
void OpenMasternodeConnection (const CAddress &addrConnect, bool probe=false)
 
bool CheckIncomingNonce (uint64_t nonce)
 
bool ForNode (NodeId id, std::function< bool(const CNode *pnode)> cond, std::function< bool(CNode *pnode)> func)
 
bool ForNode (const CService &addr, std::function< bool(const CNode *pnode)> cond, std::function< bool(CNode *pnode)> func)
 
template<typename Callable >
bool ForNode (const CService &addr, Callable &&func)
 
template<typename Callable >
bool ForNode (NodeId id, Callable &&func)
 
bool IsConnected (const CService &addr, std::function< bool(const CNode *pnode)> cond)
 
bool IsMasternodeOrDisconnectRequested (const CService &addr)
 
void PushMessage (CNode *pnode, CSerializedNetMsg &&msg)
 
template<typename Condition , typename Callable >
bool ForEachNodeContinueIf (const Condition &cond, Callable &&func)
 
template<typename Callable >
bool ForEachNodeContinueIf (Callable &&func)
 
template<typename Condition , typename Callable >
bool ForEachNodeContinueIf (const Condition &cond, Callable &&func) const
 
template<typename Callable >
bool ForEachNodeContinueIf (Callable &&func) const
 
template<typename Condition , typename Callable >
void ForEachNode (const Condition &cond, Callable &&func)
 
template<typename Callable >
void ForEachNode (Callable &&func)
 
template<typename Condition , typename Callable >
void ForEachNode (const Condition &cond, Callable &&func) const
 
template<typename Callable >
void ForEachNode (Callable &&func) const
 
template<typename Condition , typename Callable , typename CallableAfter >
void ForEachNodeThen (const Condition &cond, Callable &&pre, CallableAfter &&post)
 
template<typename Callable , typename CallableAfter >
void ForEachNodeThen (Callable &&pre, CallableAfter &&post)
 
template<typename Condition , typename Callable , typename CallableAfter >
void ForEachNodeThen (const Condition &cond, Callable &&pre, CallableAfter &&post) const
 
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 RelayTransaction (const CTransaction &tx)
 
void RelayInv (CInv &inv, const int minProtoVersion=MIN_PEER_PROTO_VERSION, bool fAllowMasternodeConnections=false)
 
void RelayInvFiltered (CInv &inv, const CTransaction &relatedTx, const int minProtoVersion=MIN_PEER_PROTO_VERSION, bool fAllowMasternodeConnections=false)
 
void RelayInvFiltered (CInv &inv, const uint256 &relatedTxHash, const int minProtoVersion=MIN_PEER_PROTO_VERSION, bool fAllowMasternodeConnections=false)
 
size_t GetAddressCount () const
 
void SetServices (const CService &addr, ServiceFlags nServices)
 
void MarkAddressGood (const CAddress &addr)
 
void AddNewAddresses (const std::vector< CAddress > &vAddr, const CAddress &addrFrom, int64_t nTimePenalty=0)
 
std::vector< CAddressGetAddresses ()
 
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)
 
void SetTryNewOutboundPeer (bool flag)
 
bool GetTryNewOutboundPeer ()
 
int GetExtraOutboundCount ()
 
bool AddNode (const std::string &node)
 
bool RemoveAddedNode (const std::string &node)
 
std::vector< AddedNodeInfoGetAddedNodeInfo ()
 
bool AddPendingMasternode (const uint256 &proTxHash)
 
void SetMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256 &quorumHash, const std::set< uint256 > &proTxHashes)
 
bool HasMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256 &quorumHash)
 
std::set< uint256GetMasternodeQuorums (Consensus::LLMQType llmqType)
 
std::set< NodeIdGetMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256 &quorumHash) const
 
void RemoveMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256 &quorumHash)
 
bool IsMasternodeQuorumNode (const CNode *pnode)
 
void AddPendingProbeConnections (const std::set< uint256 > &proTxHashes)
 
size_t GetNodeCount (NumConnections num)
 
size_t GetMaxOutboundNodeCount ()
 
void GetNodeStats (std::vector< CNodeStats > &vstats)
 
bool DisconnectNode (const std::string &node)
 
bool DisconnectNode (NodeId id)
 
ServiceFlags GetLocalServices () const
 
void SetMaxOutboundTarget (uint64_t limit)
 set the max outbound target in bytes More...
 
uint64_t GetMaxOutboundTarget ()
 
void SetMaxOutboundTimeframe (uint64_t timeframe)
 set the timeframe for the max outbound target More...
 
uint64_t GetMaxOutboundTimeframe ()
 
bool OutboundTargetReached (bool historicalBlockServingLimit)
 check if the outbound target is reached More...
 
uint64_t GetOutboundTargetBytesLeft ()
 response the bytes left in the current max outbound cycle More...
 
uint64_t GetMaxOutboundTimeLeftInCycle ()
 response the time in second left in the current max outbound cycle More...
 
uint64_t GetTotalBytesRecv ()
 
uint64_t GetTotalBytesSent ()
 
void SetBestHeight (int height)
 
int GetBestHeight () const
 
CSipHasher GetDeterministicRandomizer (uint64_t id) const
 Get a unique deterministic randomizer. More...
 
unsigned int GetReceiveFloodSize () const
 
void WakeMessageHandler ()
 
void WakeSelect ()
 
int64_t PoissonNextSendInbound (int64_t now, int average_interval_seconds)
 Attempts to obfuscate tx time through exponentially distributed emitting. More...
 

Static Public Attributes

static constexpr const CFullyConnectedOnly FullyConnectedOnly {}
 
static constexpr 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 (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 SocketEventsSelect (std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set, bool fOnlyPoll)
 
void SocketEvents (std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set, bool fOnlyPoll)
 
void SocketHandler ()
 
void ThreadSocketHandler ()
 
void ThreadDNSAddressSeed ()
 
void ThreadOpenMasternodeConnections ()
 
uint64_t CalculateKeyedNetGroup (const CAddress &ad) const
 
CNodeFindNode (const CNetAddr &ip, bool fExcludeDisconnecting=true)
 
CNodeFindNode (const CSubNet &subNet, bool fExcludeDisconnecting=true)
 
CNodeFindNode (const std::string &addrName, bool fExcludeDisconnecting=true)
 
CNodeFindNode (const CService &addr, bool fExcludeDisconnecting=true)
 
bool AttemptToEvictConnection ()
 Try to find a connection to evict when the node is full. More...
 
CNodeConnectNode (CAddress addrConnect, const char *pszDest=nullptr, bool fCountFailure=false)
 
bool IsWhitelistedRange (const CNetAddr &addr)
 
void DeleteNode (CNode *pnode)
 
NodeId GetNewNodeId ()
 
size_t SocketSendData (CNode *pnode)
 
size_t SocketRecvData (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)
 
void RegisterEvents (CNode *pnode)
 
void UnregisterEvents (CNode *pnode)
 
uint64_t nTotalBytesRecv GUARDED_BY (cs_totalBytesRecv)
 
uint64_t nTotalBytesSent GUARDED_BY (cs_totalBytesSent)
 
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY (cs_totalBytesSent)
 
uint64_t nMaxOutboundCycleStartTime GUARDED_BY (cs_totalBytesSent)
 
uint64_t nMaxOutboundLimit GUARDED_BY (cs_totalBytesSent)
 
uint64_t nMaxOutboundTimeframe GUARDED_BY (cs_totalBytesSent)
 
banmap_t setBanned GUARDED_BY (cs_setBanned)
 
bool setBannedIsDirty GUARDED_BY (cs_setBanned)
 
std::deque< std::string > vOneShots GUARDED_BY (cs_vOneShots)
 
std::vector< std::string > vAddedNodes GUARDED_BY (cs_vAddedNodes)
 
std::unordered_map< NodeId, CNode * > mapReceivableNodes GUARDED_BY (cs_vNodes)
 Protected by cs_vNodes. More...
 
std::unordered_map< NodeId, CNode * > mapSendableNodes GUARDED_BY (cs_vNodes)
 
std::unordered_map< NodeId, CNode * > mapNodesWithDataToSend GUARDED_BY (cs_mapNodesWithDataToSend)
 Protected by cs_mapNodesWithDataToSend. More...
 

Static Private Member Functions

static bool NodeFullyConnected (const CNode *pnode)
 

Private Attributes

CCriticalSection cs_totalBytesRecv
 
CCriticalSection cs_totalBytesSent
 
std::vector< CSubNetvWhitelistedRange
 
unsigned int nSendBufferMaxSize
 
unsigned int nReceiveFloodSize
 
std::vector< ListenSocketvhListenSocket
 
std::atomic< bool > fNetworkActive
 
CCriticalSection cs_setBanned
 
bool fAddressesInitialized
 
CAddrMan addrman
 
CCriticalSection cs_vOneShots
 
CCriticalSection cs_vAddedNodes
 
std::vector< uint256vPendingMasternodes
 
std::map< std::pair< Consensus::LLMQType, uint256 >, std::set< uint256 > > masternodeQuorumNodes
 
std::set< uint256masternodePendingProbes
 
CCriticalSection cs_vPendingMasternodes
 
std::vector< CNode * > vNodes
 
std::list< CNode * > vNodesDisconnected
 
std::unordered_map< SOCKET, CNode * > mapSocketToNode
 
CCriticalSection cs_vNodes
 
std::atomic< NodeIdnLastNodeId
 
unsigned int nPrevNodeCount
 
ServiceFlags nLocalServices
 Services this instance offers. More...
 
std::unique_ptr< CSemaphoresemOutbound
 
std::unique_ptr< CSemaphoresemAddnode
 
int nMaxConnections
 
int nMaxOutbound
 
int nMaxAddnode
 
int nMaxFeeler
 
std::atomic< int > nBestHeight
 
CClientUIInterfaceclientInterface
 
NetEventsInterfacem_msgproc
 
const uint64_t nSeed0
 SipHasher seeds for deterministic randomness. More...
 
const uint64_t nSeed1
 
bool fMsgProcWake
 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}
 
SocketEventsMode socketEventsMode
 
CCriticalSection cs_mapNodesWithDataToSend
 
std::thread threadDNSAddressSeed
 
std::thread threadSocketHandler
 
std::thread threadOpenAddedConnections
 
std::thread threadOpenConnections
 
std::thread threadOpenMasternodeConnections
 
std::thread threadMessageHandler
 
std::atomic_bool m_try_another_outbound_peer
 flag for deciding to connect to an extra outbound peer, in excess of nMaxOutbound This takes the place of a feeler connection More...
 
std::atomic< int64_t > m_next_send_inv_to_incoming
 

Friends

class CNode
 
struct CConnmanTest
 

Detailed Description

Definition at line 136 of file net.h.

Member Enumeration Documentation

◆ NumConnections

Enumerator
CONNECTIONS_NONE 
CONNECTIONS_IN 
CONNECTIONS_OUT 
CONNECTIONS_ALL 

Definition at line 141 of file net.h.

◆ SocketEventsMode

Enumerator
SOCKETEVENTS_SELECT 
SOCKETEVENTS_POLL 
SOCKETEVENTS_EPOLL 

Definition at line 148 of file net.h.

Constructor & Destructor Documentation

◆ CConnman()

CConnman::CConnman ( uint64_t  seed0,
uint64_t  seed1 
)

◆ ~CConnman()

CConnman::~CConnman ( )

Definition at line 3251 of file net.cpp.

References Interrupt(), and Stop().

Member Function Documentation

◆ AcceptConnection()

◆ AddNewAddresses()

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

Definition at line 3272 of file net.cpp.

References CAddrMan::Add(), and addrman.

Referenced by ProcessMessage().

◆ AddNode()

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

Definition at line 3282 of file net.cpp.

References cs_vAddedNodes, and LOCK.

◆ AddOneShot()

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

Definition at line 120 of file net.cpp.

References cs_vOneShots, and LOCK.

Referenced by Start(), and ThreadDNSAddressSeed().

◆ AddPendingMasternode()

bool CConnman::AddPendingMasternode ( const uint256 proTxHash)

◆ AddPendingProbeConnections()

void CConnman::AddPendingProbeConnections ( const std::set< uint256 > &  proTxHashes)

Definition at line 3402 of file net.cpp.

References cs_vPendingMasternodes, LOCK, and masternodePendingProbes.

◆ AttemptToEvictConnection()

bool CConnman::AttemptToEvictConnection ( )
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 1073 of file net.cpp.

References CompareNetGroupKeyed(), CompareNodeBlockTime(), CompareNodeTXTime(), cs_vNodes, EraseLastKElements(), fMasternodeMode, GetSystemTimeInSeconds(), HasAllDesirableServiceFlags(), INBOUND_EVICTION_PROTECTION_TIME, LOCK, NodeEvictionCandidate::nTimeConnected, ReverseCompareNodeMinPingTime(), ReverseCompareNodeTimeConnected(), and vNodes.

Referenced by AcceptConnection().

◆ Ban() [1/2]

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

Definition at line 605 of file net.cpp.

Referenced by SendRejectsAndCheckIfBanned().

◆ Ban() [2/2]

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

◆ BannedSetIsDirty()

bool CConnman::BannedSetIsDirty ( )
private

check is the banlist has unwritten changes

Definition at line 703 of file net.cpp.

References cs_setBanned, and LOCK.

Referenced by DumpBanlist().

◆ Bind()

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

◆ BindListenPort()

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

◆ CalculateKeyedNetGroup()

uint64_t CConnman::CalculateKeyedNetGroup ( const CAddress ad) const
private

◆ CheckIncomingNonce()

bool CConnman::CheckIncomingNonce ( uint64_t  nonce)

Definition at line 386 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

Referenced by ProcessMessage().

◆ ClearBanned()

void CConnman::ClearBanned ( )

◆ ConnectNode()

◆ CopyNodeVector() [1/2]

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

◆ CopyNodeVector() [2/2]

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

Definition at line 3845 of file net.cpp.

References AllNodes.

Referenced by ThreadMessageHandler().

◆ DeleteNode()

void CConnman::DeleteNode ( CNode pnode)
private

◆ DisconnectNode() [1/2]

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

Definition at line 3444 of file net.cpp.

References cs_vNodes, FindNode(), and LOCK.

◆ DisconnectNode() [2/2]

bool CConnman::DisconnectNode ( NodeId  id)

Definition at line 3453 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

◆ DisconnectNodes()

◆ DumpAddresses()

void CConnman::DumpAddresses ( )
private

Definition at line 2152 of file net.cpp.

References addrman, GetTimeMillis(), LogPrint, BCLog::NET, CAddrMan::size(), and CAddrDB::Write().

Referenced by DumpData(), and Start().

◆ DumpBanlist()

void CConnman::DumpBanlist ( )
private

◆ DumpData()

void CConnman::DumpData ( )
private

Definition at line 2163 of file net.cpp.

References DumpAddresses(), and DumpBanlist().

Referenced by Start(), and Stop().

◆ FindNode() [1/4]

CNode * CConnman::FindNode ( const CNetAddr ip,
bool  fExcludeDisconnecting = true 
)
private

Definition at line 330 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

Referenced by ConnectNode(), DisconnectNode(), and OpenNetworkConnection().

◆ FindNode() [2/4]

CNode * CConnman::FindNode ( const CSubNet subNet,
bool  fExcludeDisconnecting = true 
)
private

Definition at line 344 of file net.cpp.

References cs_vNodes, LOCK, CSubNet::Match(), and vNodes.

◆ FindNode() [3/4]

CNode * CConnman::FindNode ( const std::string &  addrName,
bool  fExcludeDisconnecting = true 
)
private

Definition at line 358 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

◆ FindNode() [4/4]

CNode * CConnman::FindNode ( const CService addr,
bool  fExcludeDisconnecting = true 
)
private

Definition at line 372 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

◆ ForEachNode() [1/4]

◆ ForEachNode() [2/4]

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

Definition at line 298 of file net.h.

References ForEachNode(), and FullyConnectedOnly.

◆ ForEachNode() [3/4]

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

Definition at line 304 of file net.h.

References cs_vNodes, LOCK, and vNodes.

◆ ForEachNode() [4/4]

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

Definition at line 314 of file net.h.

References ForEachNode(), and FullyConnectedOnly.

◆ ForEachNodeContinueIf() [1/4]

template<typename Condition , typename Callable >
bool CConnman::ForEachNodeContinueIf ( const Condition &  cond,
Callable &&  func 
)
inline

Definition at line 254 of file net.h.

References cs_vNodes, LOCK, and vNodes.

Referenced by ForEachNodeContinueIf().

◆ ForEachNodeContinueIf() [2/4]

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

Definition at line 265 of file net.h.

References ForEachNodeContinueIf(), and FullyConnectedOnly.

◆ ForEachNodeContinueIf() [3/4]

template<typename Condition , typename Callable >
bool CConnman::ForEachNodeContinueIf ( const Condition &  cond,
Callable &&  func 
) const
inline

Definition at line 271 of file net.h.

References cs_vNodes, LOCK, and vNodes.

◆ ForEachNodeContinueIf() [4/4]

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

Definition at line 282 of file net.h.

References ForEachNodeContinueIf(), and FullyConnectedOnly.

◆ ForEachNodeThen() [1/4]

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

Definition at line 320 of file net.h.

References cs_vNodes, LOCK, and vNodes.

Referenced by ForEachNodeThen(), and RelayAddress().

◆ ForEachNodeThen() [2/4]

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

Definition at line 331 of file net.h.

References ForEachNodeThen(), and FullyConnectedOnly.

◆ ForEachNodeThen() [3/4]

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

Definition at line 337 of file net.h.

References cs_vNodes, LOCK, and vNodes.

◆ ForEachNodeThen() [4/4]

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

Definition at line 348 of file net.h.

References ForEachNodeThen(), and FullyConnectedOnly.

◆ ForNode() [1/4]

◆ ForNode() [2/4]

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

Definition at line 3782 of file net.cpp.

References CNode::addr, cs_vNodes, LOCK, and vNodes.

◆ ForNode() [3/4]

template<typename Callable >
bool CConnman::ForNode ( const CService addr,
Callable &&  func 
)
inline

Definition at line 231 of file net.h.

References ForNode(), and FullyConnectedOnly.

◆ ForNode() [4/4]

template<typename Callable >
bool CConnman::ForNode ( NodeId  id,
Callable &&  func 
)
inline

Definition at line 237 of file net.h.

References ForNode(), and FullyConnectedOnly.

◆ GenerateSelectSet()

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

Definition at line 1442 of file net.cpp.

References cs_vNodes, INVALID_SOCKET, LOCK, vhListenSocket, vNodes, and wakeupPipe.

Referenced by SocketEventsSelect().

◆ GetAddedNodeInfo()

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

◆ GetAddressCount()

size_t CConnman::GetAddressCount ( ) const

Definition at line 3257 of file net.cpp.

References addrman, and CAddrMan::size().

Referenced by ProcessMessage().

◆ GetAddresses()

std::vector< CAddress > CConnman::GetAddresses ( )

Definition at line 3277 of file net.cpp.

References addrman, and CAddrMan::GetAddr().

Referenced by ProcessMessage().

◆ GetBanned()

void CConnman::GetBanned ( banmap_t banmap)

Definition at line 660 of file net.cpp.

References cs_setBanned, LOCK, and SweepBanned().

Referenced by DumpBanlist().

◆ GetBestHeight()

int CConnman::GetBestHeight ( ) const

Definition at line 3638 of file net.cpp.

References nBestHeight.

Referenced by AcceptConnection(), and ConnectNode().

◆ GetDeterministicRandomizer()

CSipHasher CConnman::GetDeterministicRandomizer ( uint64_t  id) const

Get a unique deterministic randomizer.

Definition at line 3858 of file net.cpp.

References nSeed0, nSeed1, and CSipHasher::Write().

Referenced by AcceptConnection(), CalculateKeyedNetGroup(), ConnectNode(), and RelayAddress().

◆ GetExtraOutboundCount()

int CConnman::GetExtraOutboundCount ( )

Definition at line 2203 of file net.cpp.

References cs_vNodes, LOCK, nMaxOutbound, and vNodes.

Referenced by PeerLogicValidation::EvictExtraOutboundPeers().

◆ GetLocalServices()

ServiceFlags CConnman::GetLocalServices ( ) const

Definition at line 3628 of file net.cpp.

References nLocalServices.

◆ GetMasternodeQuorumNodes()

std::set< NodeId > CConnman::GetMasternodeQuorumNodes ( Consensus::LLMQType  llmqType,
const uint256 quorumHash 
) const

◆ GetMasternodeQuorums()

std::set< uint256 > CConnman::GetMasternodeQuorums ( Consensus::LLMQType  llmqType)

Definition at line 3331 of file net.cpp.

References cs_vPendingMasternodes, LOCK, and masternodeQuorumNodes.

◆ GetMaxOutboundNodeCount()

size_t CConnman::GetMaxOutboundNodeCount ( )

Definition at line 3425 of file net.cpp.

References nMaxOutbound.

Referenced by CMasternodeUtils::ProcessMasternodeConnections().

◆ GetMaxOutboundTarget()

uint64_t CConnman::GetMaxOutboundTarget ( )

Definition at line 3549 of file net.cpp.

References cs_totalBytesSent, and LOCK.

◆ GetMaxOutboundTimeframe()

uint64_t CConnman::GetMaxOutboundTimeframe ( )

Definition at line 3555 of file net.cpp.

References cs_totalBytesSent, and LOCK.

◆ GetMaxOutboundTimeLeftInCycle()

uint64_t CConnman::GetMaxOutboundTimeLeftInCycle ( )

response the time in second left in the current max outbound cycle

Definition at line 3561 of file net.cpp.

References cs_totalBytesSent, GetTime(), and LOCK.

Referenced by OutboundTargetReached().

◆ GetNetworkActive()

bool CConnman::GetNetworkActive ( ) const
inline

Definition at line 206 of file net.h.

References fNetworkActive.

◆ GetNewNodeId()

NodeId CConnman::GetNewNodeId ( )
private

Definition at line 2921 of file net.cpp.

References nLastNodeId.

Referenced by AcceptConnection(), and ConnectNode().

◆ GetNodeCount()

size_t CConnman::GetNodeCount ( NumConnections  num)

Definition at line 3408 of file net.cpp.

References CONNECTIONS_IN, CONNECTIONS_OUT, cs_vNodes, flags, LOCK, and vNodes.

◆ GetNodeStats()

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

Definition at line 3430 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

◆ GetOutboundTargetBytesLeft()

uint64_t CConnman::GetOutboundTargetBytesLeft ( )

response the bytes left in the current max outbound cycle

Definition at line 3607 of file net.cpp.

References cs_totalBytesSent, and LOCK.

◆ GetReceiveFloodSize()

unsigned int CConnman::GetReceiveFloodSize ( ) const

Definition at line 3643 of file net.cpp.

References nReceiveFloodSize.

Referenced by PeerLogicValidation::ProcessMessages().

◆ GetSocketEventsMode()

SocketEventsMode CConnman::GetSocketEventsMode ( ) const
inline

Definition at line 208 of file net.h.

References socketEventsMode.

◆ GetTotalBytesRecv()

uint64_t CConnman::GetTotalBytesRecv ( )

Definition at line 3616 of file net.cpp.

References cs_totalBytesRecv, and LOCK.

◆ GetTotalBytesSent()

uint64_t CConnman::GetTotalBytesSent ( )

Definition at line 3622 of file net.cpp.

References cs_totalBytesSent, and LOCK.

◆ GetTryNewOutboundPeer()

bool CConnman::GetTryNewOutboundPeer ( )

◆ GUARDED_BY() [1/13]

uint64_t nTotalBytesRecv CConnman::GUARDED_BY ( cs_totalBytesRecv  )
private

◆ GUARDED_BY() [2/13]

uint64_t nTotalBytesSent CConnman::GUARDED_BY ( cs_totalBytesSent  )
private

◆ GUARDED_BY() [3/13]

uint64_t nMaxOutboundTotalBytesSentInCycle CConnman::GUARDED_BY ( cs_totalBytesSent  )
private

◆ GUARDED_BY() [4/13]

uint64_t nMaxOutboundCycleStartTime CConnman::GUARDED_BY ( cs_totalBytesSent  )
private

◆ GUARDED_BY() [5/13]

uint64_t nMaxOutboundLimit CConnman::GUARDED_BY ( cs_totalBytesSent  )
private

◆ GUARDED_BY() [6/13]

uint64_t nMaxOutboundTimeframe CConnman::GUARDED_BY ( cs_totalBytesSent  )
private

◆ GUARDED_BY() [7/13]

banmap_t setBanned CConnman::GUARDED_BY ( cs_setBanned  )
private

◆ GUARDED_BY() [8/13]

bool setBannedIsDirty CConnman::GUARDED_BY ( cs_setBanned  )
private

◆ GUARDED_BY() [9/13]

std::deque<std::string> vOneShots CConnman::GUARDED_BY ( cs_vOneShots  )
private

◆ GUARDED_BY() [10/13]

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

◆ GUARDED_BY() [11/13]

std::unordered_map<NodeId, CNode*> mapReceivableNodes CConnman::GUARDED_BY ( cs_vNodes  )
private

Protected by cs_vNodes.

◆ GUARDED_BY() [12/13]

std::unordered_map<NodeId, CNode*> mapSendableNodes CConnman::GUARDED_BY ( cs_vNodes  )
private

◆ GUARDED_BY() [13/13]

std::unordered_map<NodeId, CNode*> mapNodesWithDataToSend CConnman::GUARDED_BY ( cs_mapNodesWithDataToSend  )
private

Protected by cs_mapNodesWithDataToSend.

◆ HasMasternodeQuorumNodes()

bool CConnman::HasMasternodeQuorumNodes ( Consensus::LLMQType  llmqType,
const uint256 quorumHash 
)

Definition at line 3325 of file net.cpp.

References cs_vPendingMasternodes, LOCK, and masternodeQuorumNodes.

◆ InactivityCheck()

◆ Init()

◆ InitBinds()

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

Definition at line 2940 of file net.cpp.

References BF_EXPLICIT, BF_NONE, BF_REPORT_ERROR, BF_WHITELIST, Bind(), and GetListenPort().

Referenced by Start().

◆ Interrupt()

void CConnman::Interrupt ( )

◆ IsBanned() [1/2]

bool CConnman::IsBanned ( CNetAddr  ip)

Definition at line 577 of file net.cpp.

References cs_setBanned, GetTime(), LOCK, CSubNet::Match(), and CBanEntry::nBanUntil.

Referenced by AcceptConnection(), and OpenNetworkConnection().

◆ IsBanned() [2/2]

bool CConnman::IsBanned ( CSubNet  subnet)

Definition at line 591 of file net.cpp.

References cs_setBanned, GetTime(), LOCK, and CBanEntry::nBanUntil.

◆ IsConnected()

bool CConnman::IsConnected ( const CService addr,
std::function< bool(const CNode *pnode)>  cond 
)
inline

Definition at line 242 of file net.h.

References ForNode().

◆ IsMasternodeOrDisconnectRequested()

bool CConnman::IsMasternodeOrDisconnectRequested ( const CService addr)

◆ IsMasternodeQuorumNode()

◆ IsWhitelistedRange()

bool CConnman::IsWhitelistedRange ( const CNetAddr addr)
private

Definition at line 716 of file net.cpp.

References vWhitelistedRange.

Referenced by AcceptConnection().

◆ MarkAddressGood()

void CConnman::MarkAddressGood ( const CAddress addr)

Definition at line 3267 of file net.cpp.

References addrman, and CAddrMan::Good().

Referenced by ProcessMessage().

◆ NodeFullyConnected()

bool CConnman::NodeFullyConnected ( const CNode pnode)
staticprivate

◆ NotifyNumConnectionsChanged()

void CConnman::NotifyNumConnectionsChanged ( )
private

◆ OpenMasternodeConnection()

void CConnman::OpenMasternodeConnection ( const CAddress addrConnect,
bool  probe = false 
)

Definition at line 2697 of file net.cpp.

References OpenNetworkConnection().

Referenced by ThreadOpenMasternodeConnections().

◆ OpenNetworkConnection()

◆ OutboundTargetReached()

bool CConnman::OutboundTargetReached ( bool  historicalBlockServingLimit)

check if the outbound target is reached

Definition at line 3587 of file net.cpp.

References cs_totalBytesSent, fDIP0001ActiveAtTip, GetMaxOutboundTimeLeftInCycle(), LOCK, and MaxBlockSize().

Referenced by ProcessGetBlockData(), and ProcessMessage().

◆ PoissonNextSendInbound()

int64_t CConnman::PoissonNextSendInbound ( int64_t  now,
int  average_interval_seconds 
)

Attempts to obfuscate tx time through exponentially distributed emitting.

Works assuming that a single interval is used. Variable intervals will result in privacy decrease.

Definition at line 3814 of file net.cpp.

References m_next_send_inv_to_incoming, and PoissonNextSend().

Referenced by PeerLogicValidation::SendMessages().

◆ ProcessOneShot()

void CConnman::ProcessOneShot ( )
private

Definition at line 2169 of file net.cpp.

References cs_vOneShots, LOCK, OpenNetworkConnection(), and semOutbound.

Referenced by ThreadOpenConnections().

◆ PushMessage()

◆ RecordBytesRecv()

void CConnman::RecordBytesRecv ( uint64_t  bytes)
private

Definition at line 3520 of file net.cpp.

References cs_totalBytesRecv, and LOCK.

Referenced by SocketRecvData().

◆ RecordBytesSent()

void CConnman::RecordBytesSent ( uint64_t  bytes)
private

Definition at line 3526 of file net.cpp.

References cs_totalBytesSent, GetTime(), and LOCK.

Referenced by PushMessage(), and SocketHandler().

◆ RegisterEvents()

void CConnman::RegisterEvents ( CNode pnode)
private

◆ RelayInv()

void CConnman::RelayInv ( CInv inv,
const int  minProtoVersion = MIN_PEER_PROTO_VERSION,
bool  fAllowMasternodeConnections = false 
)

◆ RelayInvFiltered() [1/2]

void CConnman::RelayInvFiltered ( CInv inv,
const CTransaction relatedTx,
const int  minProtoVersion = MIN_PEER_PROTO_VERSION,
bool  fAllowMasternodeConnections = false 
)

Definition at line 3491 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

◆ RelayInvFiltered() [2/2]

void CConnman::RelayInvFiltered ( CInv inv,
const uint256 relatedTxHash,
const int  minProtoVersion = MIN_PEER_PROTO_VERSION,
bool  fAllowMasternodeConnections = false 
)

Definition at line 3506 of file net.cpp.

References cs_vNodes, LOCK, and vNodes.

◆ RelayTransaction()

void CConnman::RelayTransaction ( const CTransaction tx)

◆ ReleaseNodeVector()

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

◆ RemoveAddedNode()

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

Definition at line 3293 of file net.cpp.

References cs_vAddedNodes, and LOCK.

◆ RemoveMasternodeQuorumNodes()

void CConnman::RemoveMasternodeQuorumNodes ( Consensus::LLMQType  llmqType,
const uint256 quorumHash 
)

Definition at line 3366 of file net.cpp.

References cs_vPendingMasternodes, LOCK, and masternodeQuorumNodes.

◆ SetBanned()

void CConnman::SetBanned ( const banmap_t banmap)

Definition at line 668 of file net.cpp.

References cs_setBanned, and LOCK.

Referenced by Start().

◆ SetBannedSetDirty()

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

set the "dirty" flag for the banlist

Definition at line 709 of file net.cpp.

References cs_setBanned, and LOCK.

Referenced by DumpBanlist(), and Start().

◆ SetBestHeight()

void CConnman::SetBestHeight ( int  height)

Definition at line 3633 of file net.cpp.

References nBestHeight.

Referenced by PeerLogicValidation::UpdatedBlockTip().

◆ SetMasternodeQuorumNodes()

void CConnman::SetMasternodeQuorumNodes ( Consensus::LLMQType  llmqType,
const uint256 quorumHash,
const std::set< uint256 > &  proTxHashes 
)

Definition at line 3316 of file net.cpp.

References cs_vPendingMasternodes, LOCK, and masternodeQuorumNodes.

◆ SetMaxOutboundTarget()

void CConnman::SetMaxOutboundTarget ( uint64_t  limit)

set the max outbound target in bytes

Definition at line 3543 of file net.cpp.

References cs_totalBytesSent, and LOCK.

◆ SetMaxOutboundTimeframe()

void CConnman::SetMaxOutboundTimeframe ( uint64_t  timeframe)

set the timeframe for the max outbound target

Definition at line 3575 of file net.cpp.

References cs_totalBytesSent, GetTime(), and LOCK.

◆ SetNetworkActive()

void CConnman::SetNetworkActive ( bool  active)

◆ SetServices()

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

Definition at line 3262 of file net.cpp.

References addrman, and CAddrMan::SetServices().

Referenced by ProcessMessage().

◆ SetTryNewOutboundPeer()

void CConnman::SetTryNewOutboundPeer ( bool  flag)

◆ SocketEvents()

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

◆ SocketEventsSelect()

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

◆ SocketHandler()

◆ SocketRecvData()

◆ SocketSendData()

size_t CConnman::SocketSendData ( CNode pnode)
private

◆ Start()

◆ Stop()

◆ SweepBanned()

void CConnman::SweepBanned ( )
private

clean unused entries (if bantime has expired)

Definition at line 675 of file net.cpp.

References CClientUIInterface::BannedListChanged, clientInterface, cs_setBanned, GetTime(), LOCK, LogPrint, CBanEntry::nBanUntil, BCLog::NET, and CSubNet::ToString().

Referenced by DumpBanlist(), GetBanned(), and Start().

◆ ThreadDNSAddressSeed()

◆ ThreadMessageHandler()

◆ ThreadOpenAddedConnections()

void CConnman::ThreadOpenAddedConnections ( )
private

◆ ThreadOpenConnections()

◆ ThreadOpenMasternodeConnections()

◆ ThreadSocketHandler()

void CConnman::ThreadSocketHandler ( )
private

◆ Unban() [1/2]

bool CConnman::Unban ( const CNetAddr ip)

Definition at line 642 of file net.cpp.

◆ Unban() [2/2]

bool CConnman::Unban ( const CSubNet ip)

◆ UnregisterEvents()

void CConnman::UnregisterEvents ( CNode pnode)
private

◆ WakeMessageHandler()

void CConnman::WakeMessageHandler ( )

Definition at line 1928 of file net.cpp.

References condMsgProc, fMsgProcWake, and mutexMsgProc.

Referenced by SocketRecvData(), and PeerLogicValidation::UpdatedBlockTip().

◆ WakeSelect()

void CConnman::WakeSelect ( )

Definition at line 1937 of file net.cpp.

References LogPrint, BCLog::NET, wakeupPipe, and wakeupSelectNeeded.

Referenced by AcceptConnection(), OpenNetworkConnection(), and PushMessage().

Friends And Related Function Documentation

◆ CConnmanTest

friend struct CConnmanTest
friend

Definition at line 639 of file net.h.

◆ CNode

friend class CNode
friend

Definition at line 138 of file net.h.

Referenced by AcceptConnection(), and ConnectNode().

Member Data Documentation

◆ addrman

◆ AllNodes

◆ clientInterface

CClientUIInterface* CConnman::clientInterface
private

Definition at line 592 of file net.h.

Referenced by Ban(), Bind(), ClearBanned(), Init(), NotifyNumConnectionsChanged(), Start(), SweepBanned(), and Unban().

◆ condMsgProc

std::condition_variable CConnman::condMsgProc
private

Definition at line 601 of file net.h.

Referenced by Interrupt(), ThreadMessageHandler(), and WakeMessageHandler().

◆ cs_mapNodesWithDataToSend

CCriticalSection CConnman::cs_mapNodesWithDataToSend
mutableprivate

Definition at line 623 of file net.h.

Referenced by CNode::CloseSocketDisconnect(), PushMessage(), SocketHandler(), and Stop().

◆ cs_setBanned

CCriticalSection CConnman::cs_setBanned
private

◆ cs_totalBytesRecv

CCriticalSection CConnman::cs_totalBytesRecv
private

Definition at line 542 of file net.h.

Referenced by GetTotalBytesRecv(), RecordBytesRecv(), and Start().

◆ cs_totalBytesSent

◆ cs_vAddedNodes

CCriticalSection CConnman::cs_vAddedNodes
private

Definition at line 570 of file net.h.

Referenced by AddNode(), GetAddedNodeInfo(), Init(), and RemoveAddedNode().

◆ cs_vNodes

◆ cs_vOneShots

CCriticalSection CConnman::cs_vOneShots
private

Definition at line 568 of file net.h.

Referenced by AddOneShot(), and ProcessOneShot().

◆ cs_vPendingMasternodes

◆ fAddressesInitialized

bool CConnman::fAddressesInitialized
private

Definition at line 565 of file net.h.

Referenced by CConnman(), Start(), and Stop().

◆ flagInterruptMsgProc

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

Definition at line 603 of file net.h.

Referenced by CConnman(), Interrupt(), Start(), and ThreadMessageHandler().

◆ fMsgProcWake

bool CConnman::fMsgProcWake
private

flag for waking the message processor.

Definition at line 599 of file net.h.

Referenced by Start(), ThreadMessageHandler(), and WakeMessageHandler().

◆ fNetworkActive

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

◆ FullyConnectedOnly

◆ interruptNet

◆ m_msgproc

NetEventsInterface* CConnman::m_msgproc
private

◆ m_next_send_inv_to_incoming

std::atomic<int64_t> CConnman::m_next_send_inv_to_incoming
private

Definition at line 637 of file net.h.

Referenced by PoissonNextSendInbound().

◆ m_try_another_outbound_peer

std::atomic_bool CConnman::m_try_another_outbound_peer
private

flag for deciding to connect to an extra outbound peer, in excess of nMaxOutbound This takes the place of a feeler connection

Definition at line 635 of file net.h.

Referenced by GetTryNewOutboundPeer(), and SetTryNewOutboundPeer().

◆ mapSocketToNode

std::unordered_map<SOCKET, CNode*> CConnman::mapSocketToNode
private

◆ masternodePendingProbes

std::set<uint256> CConnman::masternodePendingProbes
private

Definition at line 573 of file net.h.

Referenced by AddPendingProbeConnections(), and ThreadOpenMasternodeConnections().

◆ masternodeQuorumNodes

◆ mutexMsgProc

std::mutex CConnman::mutexMsgProc
private

Definition at line 602 of file net.h.

Referenced by Interrupt(), Start(), ThreadMessageHandler(), and WakeMessageHandler().

◆ nBestHeight

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

Definition at line 591 of file net.h.

Referenced by GetBestHeight(), Init(), and SetBestHeight().

◆ nLastNodeId

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

Definition at line 579 of file net.h.

Referenced by CConnman(), and GetNewNodeId().

◆ nLocalServices

ServiceFlags CConnman::nLocalServices
private

Services this instance offers.

Definition at line 583 of file net.h.

Referenced by AcceptConnection(), ConnectNode(), GetLocalServices(), and Init().

◆ nMaxAddnode

int CConnman::nMaxAddnode
private

Definition at line 589 of file net.h.

Referenced by Init(), Interrupt(), and Start().

◆ nMaxConnections

int CConnman::nMaxConnections
private

Definition at line 587 of file net.h.

Referenced by AcceptConnection(), Init(), Start(), and ThreadOpenConnections().

◆ nMaxFeeler

int CConnman::nMaxFeeler
private

Definition at line 590 of file net.h.

Referenced by AcceptConnection(), Init(), Interrupt(), and Start().

◆ nMaxOutbound

int CConnman::nMaxOutbound
private

◆ nPrevNodeCount

unsigned int CConnman::nPrevNodeCount
private

Definition at line 580 of file net.h.

Referenced by CConnman(), and NotifyNumConnectionsChanged().

◆ nReceiveFloodSize

unsigned int CConnman::nReceiveFloodSize
private

Definition at line 558 of file net.h.

Referenced by CConnman(), GetReceiveFloodSize(), Init(), and SocketRecvData().

◆ nSeed0

const uint64_t CConnman::nSeed0
private

SipHasher seeds for deterministic randomness.

Definition at line 596 of file net.h.

Referenced by GetDeterministicRandomizer().

◆ nSeed1

const uint64_t CConnman::nSeed1
private

Definition at line 596 of file net.h.

Referenced by GetDeterministicRandomizer().

◆ nSendBufferMaxSize

unsigned int CConnman::nSendBufferMaxSize
private

Definition at line 557 of file net.h.

Referenced by CConnman(), Init(), and PushMessage().

◆ semAddnode

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

Definition at line 586 of file net.h.

Referenced by Interrupt(), Start(), Stop(), and ThreadOpenAddedConnections().

◆ semOutbound

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

Definition at line 585 of file net.h.

Referenced by Interrupt(), ProcessOneShot(), Start(), Stop(), and ThreadOpenConnections().

◆ socketEventsMode

SocketEventsMode CConnman::socketEventsMode
private

◆ threadDNSAddressSeed

std::thread CConnman::threadDNSAddressSeed
private

Definition at line 625 of file net.h.

Referenced by Start(), and Stop().

◆ threadMessageHandler

std::thread CConnman::threadMessageHandler
private

Definition at line 630 of file net.h.

Referenced by Start(), and Stop().

◆ threadOpenAddedConnections

std::thread CConnman::threadOpenAddedConnections
private

Definition at line 627 of file net.h.

Referenced by Start(), and Stop().

◆ threadOpenConnections

std::thread CConnman::threadOpenConnections
private

Definition at line 628 of file net.h.

Referenced by Start(), and Stop().

◆ threadOpenMasternodeConnections

std::thread CConnman::threadOpenMasternodeConnections
private

Definition at line 629 of file net.h.

Referenced by Start(), and Stop().

◆ threadSocketHandler

std::thread CConnman::threadSocketHandler
private

Definition at line 626 of file net.h.

Referenced by Start(), and Stop().

◆ vhListenSocket

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

Definition at line 560 of file net.h.

Referenced by BindListenPort(), GenerateSelectSet(), SocketHandler(), and Stop().

◆ vNodes

◆ vNodesDisconnected

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

Definition at line 576 of file net.h.

Referenced by DisconnectNodes(), and Stop().

◆ vPendingMasternodes

std::vector<uint256> CConnman::vPendingMasternodes
private

Definition at line 571 of file net.h.

Referenced by AddPendingMasternode(), and ThreadOpenMasternodeConnections().

◆ vWhitelistedRange

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

Definition at line 555 of file net.h.

Referenced by Init(), and IsWhitelistedRange().

◆ wakeupPipe

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

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

Definition at line 609 of file net.h.

Referenced by GenerateSelectSet(), SocketHandler(), Start(), Stop(), and WakeSelect().

◆ wakeupSelectNeeded

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

Definition at line 611 of file net.h.

Referenced by PushMessage(), SocketEventsSelect(), and WakeSelect().


The documentation for this class was generated from the following files:
Released under the MIT license