Bitcoin Core  26.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
ConnmanTestMsg Struct Reference

#include <net.h>

Inheritance diagram for ConnmanTestMsg:
[legend]
Collaboration diagram for ConnmanTestMsg:
[legend]

Public Member Functions

void SetPeerConnectTimeout (std::chrono::seconds timeout)
 
std::vector< CNode * > TestNodes ()
 
void AddTestNode (CNode &node)
 
void ClearTestNodes ()
 
void NodeReceiveMsgBytes (CNode &node, Span< const uint8_t > msg_bytes, bool &complete) const
 
bool ReceiveMsgFrom (CNode &node, CSerializedNetMsg &&ser_msg) const
 
void FlushSendBuffer (CNode &node) const
 
bool AlreadyConnectedPublic (const CAddress &addr)
 
CNodeConnectNodePublic (PeerManager &peerman, const char *pszDest, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
 
 CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, const CChainParams &params, bool network_active=true)
 
- Public Member Functions inherited from CConnman
void Init (const Options &connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex
 
const bool use_v2transport (GetLocalServices() &NODE_P2P_V2)
 
 for (const std::string &added_node :connOptions.m_added_nodes)
 
 CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, const CChainParams &params, bool network_active=true)
 
 ~CConnman ()
 
bool Start (CScheduler &scheduler, const Options &options) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex
 
void StopThreads ()
 
void StopNodes ()
 
void Stop ()
 
void Interrupt () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
 
bool GetNetworkActive () const
 
bool GetUseAddrmanOutgoing () const
 
void SetNetworkActive (bool active)
 
void OpenNetworkConnection (const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant &&grant_outbound, const char *strDest, ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
 
bool CheckIncomingNonce (uint64_t nonce)
 
void ASMapHealthCheck ()
 
RecursiveMutexGetNodesMutex () const LOCK_RETURNED(m_nodes_mutex)
 
bool ForNode (NodeId id, std::function< bool(CNode *pnode)> func)
 
void PushMessage (CNode *pnode, CSerializedNetMsg &&msg) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
void ForEachNode (const NodeFn &func)
 
void ForEachNode (const NodeFn &func) const
 
std::vector< CAddressGetAddresses (size_t max_addresses, size_t max_pct, std::optional< Network > network, const bool filtered=true) const
 Return all or many randomly selected addresses, optionally by network. More...
 
std::vector< CAddressGetAddresses (CNode &requestor, size_t max_addresses, size_t max_pct)
 Cache is used to minimize topology leaks, so it should be used for all non-trusted calls, for example, p2p. More...
 
void SetTryNewOutboundPeer (bool flag)
 
bool GetTryNewOutboundPeer () const
 
void StartExtraBlockRelayPeers ()
 
int GetExtraFullOutboundCount () const
 
int GetExtraBlockRelayCount () const
 
bool AddNode (const AddedNodeParams &add) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
bool RemoveAddedNode (const std::string &node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
bool AddedNodesContain (const CAddress &addr) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
std::vector< AddedNodeInfoGetAddedNodeInfo (bool include_connected) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
bool AddConnection (const std::string &address, ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
 Attempts to open a connection. More...
 
size_t GetNodeCount (ConnectionDirection) const
 
uint32_t GetMappedAS (const CNetAddr &addr) const
 
void GetNodeStats (std::vector< CNodeStats > &vstats) const
 
bool DisconnectNode (const std::string &node)
 
bool DisconnectNode (const CSubNet &subnet)
 
bool DisconnectNode (const CNetAddr &addr)
 
bool DisconnectNode (NodeId id)
 
ServiceFlags GetLocalServices () const
 Used to convey which local services we are offering peers during node connection. More...
 
uint64_t GetMaxOutboundTarget () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
std::chrono::seconds GetMaxOutboundTimeframe () const
 
bool OutboundTargetReached (bool historicalBlockServingLimit) const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 check if the outbound target is reached if param historicalBlockServingLimit is set true, the function will response true if the limit for serving historical blocks has been reached More...
 
uint64_t GetOutboundTargetBytesLeft () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 response the bytes left in the current max outbound cycle in case of no limit, it will always response 0 More...
 
std::chrono::seconds GetMaxOutboundTimeLeftInCycle () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
uint64_t GetTotalBytesRecv () const
 
uint64_t GetTotalBytesSent () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
CSipHasher GetDeterministicRandomizer (uint64_t id) const
 Get a unique deterministic randomizer. More...
 
void WakeMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
 
bool ShouldRunInactivityChecks (const CNode &node, std::chrono::seconds now) const
 Return true if we should disconnect the peer for failing an inactivity check. More...
 
bool MultipleManualOrFullOutboundConns (Network net) const EXCLUSIVE_LOCKS_REQUIRED(m_nodes_mutex)
 

Public Attributes

void Handshake(CNode &node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface bool ProcessMessagesOnce (CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
 
- Public Attributes inherited from CConnman
void !m_total_bytes_sent_mutex
 
 nLocalServices = connOptions.nLocalServices
 
 m_max_automatic_connections = connOptions.m_max_automatic_connections
 
 m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, m_max_automatic_connections)
 
 m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, m_max_automatic_connections - m_max_outbound_full_relay)
 
 m_max_automatic_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + m_max_feeler
 
 m_max_inbound = std::max(0, m_max_automatic_connections - m_max_automatic_outbound)
 
 m_use_addrman_outgoing = connOptions.m_use_addrman_outgoing
 
 m_client_interface = connOptions.uiInterface
 
 m_banman = connOptions.m_banman
 
 m_msgproc = connOptions.m_msgproc
 
 nSendBufferMaxSize = connOptions.nSendBufferMaxSize
 
 nReceiveFloodSize = connOptions.nReceiveFloodSize
 
 m_peer_connect_timeout = std::chrono::seconds{connOptions.m_peer_connect_timeout}
 
 nMaxOutboundLimit = connOptions.nMaxOutboundLimit
 
 vWhitelistedRange = connOptions.vWhitelistedRange
 
 m_onion_binds = connOptions.onion_binds
 
bool !m_added_nodes_mutex
 
bool !m_addr_fetches_mutex
 
bool !mutexMsgProc
 

Additional Inherited Members

- Public Types inherited from CConnman
using NodeFn = std::function< void(CNode *)>
 

Detailed Description

Definition at line 34 of file net.h.

Member Function Documentation

◆ AddTestNode()

void ConnmanTestMsg::AddTestNode ( CNode node)
inline

Definition at line 48 of file net.h.

Here is the caller graph for this function:

◆ AlreadyConnectedPublic()

bool ConnmanTestMsg::AlreadyConnectedPublic ( const CAddress addr)
inline

Definition at line 83 of file net.h.

Here is the call graph for this function:

◆ CConnman()

CConnman::CConnman

Definition at line 1103 of file net.cpp.

◆ ClearTestNodes()

void ConnmanTestMsg::ClearTestNodes ( )
inline

Definition at line 56 of file net.h.

◆ ConnectNodePublic()

CNode * ConnmanTestMsg::ConnectNodePublic ( PeerManager peerman,
const char *  pszDest,
ConnectionType  conn_type 
)

Definition at line 104 of file net.cpp.

Here is the call graph for this function:

◆ FlushSendBuffer()

void ConnmanTestMsg::FlushSendBuffer ( CNode node) const

Definition at line 78 of file net.cpp.

Here is the caller graph for this function:

◆ NodeReceiveMsgBytes()

void ConnmanTestMsg::NodeReceiveMsgBytes ( CNode node,
Span< const uint8_t >  msg_bytes,
bool &  complete 
) const

Definition at line 70 of file net.cpp.

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

◆ ReceiveMsgFrom()

bool ConnmanTestMsg::ReceiveMsgFrom ( CNode node,
CSerializedNetMsg &&  ser_msg 
) const

Definition at line 90 of file net.cpp.

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

◆ SetPeerConnectTimeout()

void ConnmanTestMsg::SetPeerConnectTimeout ( std::chrono::seconds  timeout)
inline

Definition at line 37 of file net.h.

Here is the caller graph for this function:

◆ TestNodes()

std::vector<CNode*> ConnmanTestMsg::TestNodes ( )
inline

Definition at line 42 of file net.h.

Member Data Documentation

◆ ProcessMessagesOnce

void Handshake (CNode& node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface bool ConnmanTestMsg::ProcessMessagesOnce(CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
inline

Definition at line 73 of file net.h.


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