|
| 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_reconnections_mutex) |
| |
| void | Stop () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex) |
| |
| 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_unused_i2p_sessions_mutex) |
| | Open a new P2P connection and initialize it with the PeerManager at m_msgproc.
|
| |
| bool | CheckIncomingNonce (uint64_t nonce) |
| |
| void | ASMapHealthCheck () |
| |
| RecursiveMutex & | GetNodesMutex () 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< CAddress > | GetAddressesUnsafe (size_t max_addresses, size_t max_pct, std::optional< Network > network, bool filtered=true) const |
| | Return randomly selected addresses.
|
| |
| std::vector< CAddress > | GetAddresses (CNode &requestor, size_t max_addresses, size_t max_pct) |
| | Return addresses from the per-requestor cache.
|
| |
| void | SetTryNewOutboundPeer (bool flag) |
| |
| bool | GetTryNewOutboundPeer () const |
| |
| void | StartExtraBlockRelayPeers () |
| |
| int | GetFullOutboundConnCount () const |
| |
| int | GetExtraFullOutboundCount () const |
| |
| int | GetExtraBlockRelayCount () const |
| |
| 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_unused_i2p_sessions_mutex) |
| | Attempts to open a connection.
|
| |
| size_t | GetNodeCount (ConnectionDirection) const |
| |
| std::map< CNetAddr, LocalServiceInfo > | getNetLocalAddresses () const |
| |
| uint32_t | GetMappedAS (const CNetAddr &addr) const |
| |
| void | GetNodeStats (std::vector< CNodeStats > &vstats) const |
| |
| bool | DisconnectNode (std::string_view 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.
|
| |
| void | AddLocalServices (ServiceFlags services) |
| | Updates the local services that this node advertises to other peers during connection handshake.
|
| |
| 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
|
| |
| 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
|
| |
| 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.
|
| |
| void | WakeMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) |
| |
| bool | ShouldRunInactivityChecks (const CNode &node, std::chrono::microseconds now) const |
| | Return true if we should disconnect the peer for failing an inactivity check.
|
| |
| 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
|
| |
| 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_addr_fetches_mutex |
| |
| void | ThreadMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) |
| |
| void | ThreadI2PAcceptIncoming () |
| |
| void | ThreadPrivateBroadcast () EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex) |
| |
| void | AcceptConnection (const ListenSocket &hListenSocket) |
| |
| void | CreateNodeFromAcceptedSocket (std::unique_ptr< Sock > &&sock, NetPermissionFlags permission_flags, const CService &addr_bind, const CService &addr) |
| | Create a CNode object from a socket that has just been accepted and add the node to the m_nodes member.
|
| |
| void | DisconnectNodes () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex |
| |
| void | NotifyNumConnectionsChanged () |
| |
| bool | InactivityCheck (const CNode &node, std::chrono::microseconds now) const |
| | Return true if the peer is inactive and should be disconnected.
|
| |
| Sock::EventsPerSock | GenerateWaitSockets (std::span< CNode *const > nodes) |
| | Generate a collection of sockets to check for IO readiness.
|
| |
| void | SocketHandler () EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex |
| | Check connected and listening sockets for IO readiness and process them accordingly.
|
| |
| 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.
|
| |
| void | SocketHandlerListening (const Sock::EventsPerSock &events_per_sock) |
| | Accept incoming connections, one from each read-ready listening socket.
|
| |
| 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 |
| | Determine whether we're already connected to a given "host:port".
|
| |
| bool | AlreadyConnectedToAddressPort (const CService &addr_port) const |
| | Determine whether we're already connected to a given address:port.
|
| |
| bool | AlreadyConnectedToAddress (const CNetAddr &addr) const |
| | Determine whether we're already connected to a given address.
|
| |
| bool | AttemptToEvictConnection () |
| | Try to find a connection to evict when the node is full.
|
| |
| 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_unused_i2p_sessions_mutex) |
| | Open a new P2P connection.
|
| |
| 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.
|
| |
| 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.
|
| |
| std::vector< CAddress > | GetCurrentBlockRelayOnlyConns () const |
| | Return vector of current BLOCK_RELAY peers.
|
| |
| bool | MaybePickPreferredNetwork (std::optional< Network > &network) |
| | Search for a "preferred" network, a reachable network to which we currently don't have any OUTBOUND_FULL_RELAY or MANUAL connections.
|
| |
| 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.
|
| |
| 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.
|
| |
| std::list< ReconnectionInfo > m_reconnections | GUARDED_BY (m_reconnections_mutex) |
| | List of reconnections we have to make.
|
| |
| void | PerformReconnections () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex |
| | Attempt reconnections, if m_reconnections non-empty.
|
| |
Definition at line 1071 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 1640 of file net.h.
Services this node offers.
This data is replicated in each Peer instance we create.
This data is not marked const, but after being set it should not change. Unless AssumeUTXO is started, in which case, the peer will be limited until the background chain sync finishes.
- See also
- Peer::our_services
Definition at line 1653 of file net.h.