|
| 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) |
| |
| void | SetCaptureMessages (bool cap) |
| |
| | CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, const CChainParams ¶ms, bool network_active=true, std::shared_ptr< CThreadInterrupt > interrupt_net=std::make_shared< CThreadInterrupt >()) |
| |
| | ~CConnman () |
| |
| bool | Start (CScheduler &scheduler, const Options &options) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex |
| |
| void | StopThreads () |
| |
| void | StopNodes () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| |
| void | Stop () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| |
| | AssertLockNotHeld (m_reconnections_mutex) |
| |
| | StopThreads () |
| |
| | StopNodes () |
| |
| void | Interrupt () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) |
| |
| bool | GetNetworkActive () const |
| |
| bool | GetUseAddrmanOutgoing () const |
| |
| void | SetNetworkActive (bool active) |
| |
| bool | OpenNetworkConnection (const CAddress &addrConnect, bool fCountFailure, CountingSemaphoreGrant<> &&grant_outbound, const char *pszDest, ConnectionType conn_type, bool use_v2transport, const std::optional< Proxy > &proxy_override=std::nullopt) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| | Open a new P2P connection and initialize it with the PeerManager at m_msgproc. More...
|
| |
| bool | CheckIncomingNonce (uint64_t nonce) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| void | ASMapHealthCheck () |
| |
| Mutex & | GetNodesMutex () const LOCK_RETURNED(m_nodes_mutex) |
| |
| bool | ForNode (NodeId id, std::function< bool(CNode *pnode)> func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| void | PushMessage (CNode *pnode, CSerializedNetMsg &&msg) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex) |
| |
| void | ForEachNode (const NodeFn &func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| void | ForEachNode (const NodeFn &func) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| std::vector< CAddress > | GetAddressesUnsafe (size_t max_addresses, size_t max_pct, std::optional< Network > network, bool filtered=true) const |
| | Return randomly selected addresses. More...
|
| |
| std::vector< CAddress > | GetAddresses (CNode &requestor, size_t max_addresses, size_t max_pct) |
| | Return addresses from the per-requestor cache. More...
|
| |
| void | SetTryNewOutboundPeer (bool flag) |
| |
| bool | GetTryNewOutboundPeer () const |
| |
| void | StartExtraBlockRelayPeers () |
| |
| int | GetFullOutboundConnCount () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| int | GetExtraFullOutboundCount () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| int | GetExtraBlockRelayCount () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| bool | AddNode (const AddedNodeParams &add) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex) |
| |
| bool | RemoveAddedNode (std::string_view node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex) |
| |
| bool | AddedNodesContain (const CAddress &addr) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex) |
| |
| std::vector< AddedNodeInfo > | GetAddedNodeInfo (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_nodes_mutex |
| | Attempts to open a connection. More...
|
| |
| size_t | GetNodeCount (ConnectionDirection) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| std::map< CNetAddr, LocalServiceInfo > | getNetLocalAddresses () const |
| |
| uint32_t | GetMappedAS (const CNetAddr &addr) const |
| |
| void | GetNodeStats (std::vector< CNodeStats > &vstats) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| bool | DisconnectNode (std::string_view node) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| bool | DisconnectNode (const CSubNet &subnet) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| bool | DisconnectNode (const CNetAddr &addr) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| bool | DisconnectNode (NodeId id) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| ServiceFlags | GetLocalServices () const |
| | Used to convey which local services we are offering peers during node connection. More...
|
| |
| void | AddLocalServices (ServiceFlags services) |
| | Updates the local services that this node advertises to other peers during connection handshake. More...
|
| |
| void | RemoveLocalServices (ServiceFlags services) |
| |
| 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, NodeClock::time_point 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) |
| |
|
| std::chrono::seconds | GetMaxOutboundTimeLeftInCycle_ () const EXCLUSIVE_LOCKS_REQUIRED(m_total_bytes_sent_mutex) |
| | returns the time left in the current max outbound cycle in case of no limit, it will always return 0 More...
|
| |
| bool | BindListenPort (const CService &bindAddr, bilingual_str &strError, NetPermissionFlags permissions) |
| |
| bool | Bind (const CService &addr, unsigned int flags, NetPermissionFlags permissions) |
| |
| bool | InitBinds (const Options &options) |
| |
| void | ThreadOpenAddedConnections () EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex |
| |
| void | AddAddrFetch (const std::string &strDest) EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex) |
| |
| void | ProcessAddrFetch () EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex |
| |
| void | ThreadOpenConnections (std::vector< std::string > connect, std::span< const std::string > seed_nodes) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex |
| |
| void | ThreadMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| |
| void | ThreadI2PAcceptIncoming () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| void | ThreadPrivateBroadcast () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| |
| void | AcceptConnection (const ListenSocket &hListenSocket) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| void | CreateNodeFromAcceptedSocket (std::unique_ptr< Sock > &&sock, NetPermissionFlags permission_flags, const CService &addr_bind, const CService &addr) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Create a CNode object from a socket that has just been accepted and add the node to the m_nodes member. More...
|
| |
| void | DisconnectNodes () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex |
| |
| void | NotifyNumConnectionsChanged () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| |
| bool | InactivityCheck (const CNode &node, NodeClock::time_point now) const |
| | Return true if the peer is inactive and should be disconnected. More...
|
| |
| Sock::EventsPerSock | GenerateWaitSockets (std::span< CNode *const > nodes) |
| | Generate a collection of sockets to check for IO readiness. More...
|
| |
| void | SocketHandler () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| | Check connected and listening sockets for IO readiness and process them accordingly. More...
|
| |
| void | SocketHandlerConnected (const std::vector< CNode * > &nodes, const Sock::EventsPerSock &events_per_sock) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex |
| | Do the read/write for connected sockets that are ready for IO. More...
|
| |
| void | SocketHandlerListening (const Sock::EventsPerSock &events_per_sock) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Accept incoming connections, one from each read-ready listening socket. More...
|
| |
| void | ThreadSocketHandler () EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex |
| |
| void | ThreadDNSAddressSeed () EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex |
| |
| uint64_t | CalculateKeyedNetGroup (const CNetAddr &ad) const |
| |
| bool | AlreadyConnectedToHost (std::string_view host) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Determine whether we're already connected to a given "host:port". More...
|
| |
| bool | AlreadyConnectedToAddressPort (const CService &addr_port) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Determine whether we're already connected to a given address:port. More...
|
| |
| bool | AlreadyConnectedToAddress (const CNetAddr &addr) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Determine whether we're already connected to a given address. More...
|
| |
| bool | AttemptToEvictConnection () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Try to find a connection to evict when the node is full. More...
|
| |
| CNode * | ConnectNode (CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type, bool use_v2transport, const std::optional< Proxy > &proxy_override) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| | Open a new P2P connection. More...
|
| |
| void | AddWhitelistPermissionFlags (NetPermissionFlags &flags, std::optional< CNetAddr > addr, const std::vector< NetWhitelistPermissions > &ranges) const |
| |
| void | DeleteNode (CNode *pnode) |
| |
| NodeId | GetNewNodeId () |
| |
| std::pair< size_t, bool > | SocketSendData (CNode &node) const EXCLUSIVE_LOCKS_REQUIRED(node.cs_vSend) |
| | (Try to) send data from node's vSendMsg. More...
|
| |
| void | DumpAddresses () |
| |
| void | RecordBytesRecv (uint64_t bytes) |
| |
| void | RecordBytesSent (uint64_t bytes) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex) |
| |
| std::unordered_set< Network > | GetReachableEmptyNetworks () const |
| | Return reachable networks for which we have no addresses in addrman and therefore may require loading fixed seeds. More...
|
| |
| std::vector< CAddress > | GetCurrentBlockRelayOnlyConns () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Return vector of current BLOCK_RELAY peers. More...
|
| |
| bool | MaybePickPreferredNetwork (std::optional< Network > &network) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) |
| | Search for a "preferred" network, a reachable network to which we currently don't have any OUTBOUND_FULL_RELAY or MANUAL connections. More...
|
| |
| uint16_t | GetDefaultPort (Network net) const |
| |
| uint16_t | GetDefaultPort (const std::string &addr) const |
| |
| uint64_t nTotalBytesSent | GUARDED_BY (m_total_bytes_sent_mutex) |
| |
| uint64_t nMaxOutboundTotalBytesSentInCycle | GUARDED_BY (m_total_bytes_sent_mutex) |
| |
| std::chrono::seconds nMaxOutboundCycleStartTime | GUARDED_BY (m_total_bytes_sent_mutex) |
| |
| uint64_t nMaxOutboundLimit | GUARDED_BY (m_total_bytes_sent_mutex) |
| |
| std::deque< std::string > m_addr_fetches | GUARDED_BY (m_addr_fetches_mutex) |
| |
| std::vector< AddedNodeParams > m_added_node_params | GUARDED_BY (m_added_nodes_mutex) |
| |
| std::vector< CNode * > m_nodes | GUARDED_BY (m_nodes_mutex) |
| |
| std::array< unsigned int, Network::NET_MAX > m_network_conn_counts | GUARDED_BY (m_nodes_mutex) |
| |
| bool fMsgProcWake | GUARDED_BY (mutexMsgProc) |
| | flag for waking the message processor. More...
|
| |
| std::queue< std::unique_ptr< i2p::sam::Session > > m_unused_i2p_sessions | GUARDED_BY (m_unused_i2p_sessions_mutex) |
| | A pool of created I2P SAM transient sessions that should be used instead of creating new ones in order to reduce the load on the I2P network. More...
|
| |
| std::list< ReconnectionInfo > m_reconnections | GUARDED_BY (m_reconnections_mutex) |
| | List of reconnections we have to make. More...
|
| |
| void | PerformReconnections () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex |
| | Attempt reconnections, if m_reconnections non-empty. More...
|
| |
Definition at line 1070 of file net.h.
Addr responses stored in different caches per (network, local socket) prevent cross-network node identification.
If a node for example is multi-homed under Tor and IPv6, a single cache (or no cache at all) would let an attacker to easily detect that it is the same node by comparing responses. Indexing by local socket prevents leakage when a node has multiple listening addresses on the same network.
The used memory equals to 1000 CAddress records (or around 40 bytes) per distinct Network (up to 5) we have/had an inbound peer from, resulting in at most ~196 KB. Every separate local socket may add up to ~196 KB extra.
Definition at line 1658 of file net.h.