33 #include <condition_variable> 122 std::vector<unsigned char>
data;
295 hdrbuf(nTypeIn, nVersionIn),
296 vRecv(nTypeIn, nVersionIn)
523 std::atomic<std::chrono::microseconds>
m_min_ping_time{std::chrono::microseconds::max()};
526 std::shared_ptr<Sock> sock,
528 uint64_t nKeyedNetGroupIn,
529 uint64_t nLocalHostNonceIn,
531 const std::string& addrNameIn,
730 bool network_active =
true);
755 using NodeFn = std::function<void(CNode*)>;
759 for (
auto&&
node : m_nodes) {
768 for (
auto&&
node : m_nodes) {
782 std::vector<CAddress>
GetAddresses(
size_t max_addresses,
size_t max_pct, std::optional<Network> network)
const;
789 std::vector<CAddress>
GetAddresses(
CNode& requestor,
size_t max_addresses,
size_t max_pct);
874 : sock{sock_}, m_permissions{permissions_}
934 const
Sock::EventsPerSock& events_per_sock)
1179 const std::vector<CNode*>&
Nodes()
const 1194 const std::string& msg_type,
1199 extern std::function<void(
const CAddress& addr,
1200 const std::string& msg_type,
1205 #endif // BITCOIN_NET_H bool RemoveAddedNode(const std::string &node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
std::chrono::microseconds m_min_ping_time
std::vector< CService > vBinds
int m_max_outbound_full_relay
std::atomic< bool > flagInterruptMsgProc
std::vector< CAddress > m_addrs_response_cache
static const int MAX_BLOCK_RELAY_ONLY_CONNECTIONS
Maximum number of block-relay-only outgoing connections.
uint64_t CalculateKeyedNetGroup(const CAddress &ad) const
CONSTEXPR_IF_NOT_DEBUG Span< C > subspan(std::size_t offset) const noexcept
bool IsReachable(enum Network net)
std::atomic_bool fPauseSend
CNetMessage GetMessage(std::chrono::microseconds time, bool &reject_message) override
AddrFetch connections are short lived connections used to solicit addresses from peers.
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable).
bool m_i2p_accept_incoming
CService MaybeFlipIPv6toCJDNS(const CService &service)
If an IPv6 address belongs to the address range used by the CJDNS network and the CJDNS network is re...
void ThreadDNSAddressSeed() EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex
std::atomic< bool > fNetworkActive
mapMsgTypeSize mapSendBytesPerMsgType
static void AddFlag(NetPermissionFlags &flags, NetPermissionFlags f)
ServiceFlags
nServices flags
Inbound connections are those initiated by a peer.
int readData(Span< const uint8_t > msg_bytes)
int m_max_outbound_block_relay
void SocketHandler() EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex
Check connected and listening sockets for IO readiness and process them accordingly.
NetPermissionFlags permission_flags
bool Bind(const CService &addr, unsigned int flags, NetPermissionFlags permissions)
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...
Feeler connections are short-lived connections made to check that a node is alive.
Mutex m_total_bytes_sent_mutex
std::shared_ptr< Sock > sock
std::list< CNode * > m_nodes_disconnected
void SetVersion(int nVersionIn) override
std::atomic_bool m_has_all_wanted_services
Whether this peer provides all services that we want.
static constexpr size_t MAX_UNUSED_I2P_SESSIONS_SIZE
Cap on the size of m_unused_i2p_sessions, to ensure it does not unexpectedly use too much memory...
const uint64_t nKeyedNetGroup
bool SeenLocal(const CService &addr)
vote for a local address
std::map< std::string, uint64_t > mapMsgTypeSize
CNode & operator=(const CNode &)=delete
bool IsOutboundOrBlockRelayConn() const
const std::chrono::seconds m_connected
Unix epoch time at peer connection.
const std::unique_ptr< TransportDeserializer > m_deserializer
std::vector< unsigned char > data
const ConnectionType m_conn_type
uint64_t GetTotalBytesRecv() const
std::vector< NetWhitelistPermissions > vWhitelistedRange
bool IsFeelerConn() const
unsigned int nReceiveFloodSize
int m_max_outbound_full_relay
CClientUIInterface * uiInterface
std::vector< CService > m_onion_binds
A vector of -bind=<address>:<port>=onion arguments each of which is an address and port that are desi...
virtual void prepareForTransport(CSerializedNetMsg &msg, std::vector< unsigned char > &header) const =0
bool AlreadyConnectedToAddress(const CAddress &addr)
Determine whether we're already connected to a given address, in order to avoid initiating duplicate ...
void AddWhitelistPermissionFlags(NetPermissionFlags &flags, const CNetAddr &addr) const
CDataStream m_recv
received message data
static const bool DEFAULT_LISTEN
-listen default
CNetMessage(CDataStream &&recv_in)
RAII-style semaphore lock.
friend struct CConnmanTest
void Interrupt() EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
void SetCommonVersion(int greatest_common_version)
static const int MAX_ADDNODE_CONNECTIONS
Maximum number of addnode outgoing nodes.
bool BindListenPort(const CService &bindAddr, bilingual_str &strError, NetPermissionFlags permissions)
RecursiveMutex cs_vProcessMsg
uint32_t m_message_size
size of the payload
std::optional< CService > GetLocalAddrForPeer(CNode &node)
Returns a local address that we should advertise to this peer.
Interface for message handling.
void SetVersion(int nVersionIn)
NetEventsInterface * m_msgproc
CSerializedNetMsg()=default
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
void ForEachNode(const NodeFn &func) const
int m_max_outbound_block_relay
Double ended buffer combining vector and stream-like interfaces.
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 ...
void SetTryNewOutboundPeer(bool flag)
A hasher class for Bitcoin's 256-bit hash (double SHA-256).
std::chrono::seconds m_last_recv
void RecordBytesSent(uint64_t bytes) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
const bool m_prefer_evict
uint64_t GetLocalNonce() const
m_max_outbound_block_relay
bool AddNode(const std::string &node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
ConnectionType m_conn_type
These are the default connections that we use to connect with the network.
std::shared_ptr< Sock > m_sock GUARDED_BY(m_sock_mutex)
Socket used for communication with the node.
uint64_t nSendBytes GUARDED_BY(cs_vSend)
std::vector< CAddress > GetAddresses(size_t max_addresses, size_t max_pct, std::optional< Network > network) const
Return all or many randomly selected addresses, optionally by network.
void GetNodeStats(std::vector< CNodeStats > &vstats) const
Signals for UI communication.
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(m_total_bytes_sent_mutex)
static constexpr std::chrono::minutes TIMEOUT_INTERVAL
Time after which to disconnect, after waiting for a ping response (or inactivity).
std::list< CNetMessage > vRecvMsg
bool GetTryNewOutboundPeer() const
void NotifyNumConnectionsChanged()
std::map< uint64_t, CachedAddrResponse > m_addr_response_caches
Addr responses stored in different caches per (network, local socket) prevent cross-network node iden...
void Init(const Options &connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex
uint64_t GetMaxOutboundTarget() const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
void ProcessAddrFetch() EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex
static const int MAX_FEELER_CONNECTIONS
Maximum number of feeler connections.
static bool HasFlag(NetPermissionFlags flags, NetPermissionFlags f)
Stochastic address manager.
virtual ~TransportDeserializer()
void AddSocketPermissionFlags(NetPermissionFlags &flags) const
bool ForNode(NodeId id, std::function< bool(CNode *pnode)> func)
NetPermissionFlags m_permission_flags
RecursiveMutex cs_sendProcessing
ServiceFlags nLocalServices
Services this node offers.
bool ReceiveMsgBytes(Span< const uint8_t > msg_bytes, bool &complete) EXCLUSIVE_LOCKS_REQUIRED(!cs_vRecv)
Receive bytes from the buffer and deserialize them into messages.
Mutex m_unused_i2p_sessions_mutex
Mutex protecting m_i2p_sam_sessions.
bool DisconnectNode(const std::string &node)
int GetExtraBlockRelayCount() const
void RecordBytesRecv(uint64_t bytes)
std::function< void(const CAddress &addr, const std::string &msg_type, Span< const unsigned char > data, bool is_incoming)> CaptureMessage
Defaults to CaptureMessageToFile(), but can be overridden by unit tests.
static const size_t DEFAULT_MAXRECEIVEBUFFER
std::thread threadI2PAcceptIncoming
CService GetLocalAddress(const CNetAddr &addrPeer)
void SetAddrLocal(const CService &addrLocalIn) EXCLUSIVE_LOCKS_REQUIRED(!m_addr_local_mutex)
May not be called more than once.
virtual void InitializeNode(CNode &node, ServiceFlags our_services)=0
Initialize a peer (setup state, queue any initial messages)
CSerializedNetMsg Copy() const
size_t nProcessQueueSize GUARDED_BY(cs_vProcessMsg)
ListenSocket(std::shared_ptr< Sock > sock_, NetPermissionFlags permissions_)
std::atomic_bool m_bloom_filter_loaded
Whether this peer has loaded a bloom filter.
std::chrono::microseconds m_cache_entry_expiration
bool GetLocal(CService &addr, const CNetAddr *paddrPeer=nullptr)
static bool NodeFullyConnected(const CNode *pnode)
unsigned int nPrevNodeCount
bool InactivityCheck(const CNode &node) const
Return true if the peer is inactive and should be disconnected.
std::condition_variable condMsgProc
std::atomic_bool m_start_extra_block_relay_peers
flag for initiating extra block-relay-only peer connections.
void resize(size_type n, value_type c=value_type{})
std::chrono::seconds m_connected
std::vector< AddedNodeInfo > GetAddedNodeInfo() const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
Mutex m_added_nodes_mutex
virtual int Read(Span< const uint8_t > &msg_bytes)=0
read and deserialize data, advances msg_bytes data pointer
GlobalMutex g_maplocalhost_mutex
We open manual connections to addresses that users explicitly requested via the addnode RPC or the -a...
size_t SocketSendData(CNode &node) const EXCLUSIVE_LOCKS_REQUIRED(node.cs_vSend)
const uint64_t nSeed0
SipHasher seeds for deterministic randomness.
int Read(Span< const uint8_t > &msg_bytes) override
read and deserialize data, advances msg_bytes data pointer
std::atomic_bool m_relays_txs
Whether we should relay transactions to this peer (their version message did not include fRelay=false...
std::thread threadOpenAddedConnections
std::string ConnectionTypeAsString(ConnectionType conn_type)
Convert ConnectionType enum to a string value.
void StartExtraBlockRelayPeers()
CNode * FindNode(const CNetAddr &ip)
ServiceFlags GetLocalServices() const
Used to convey which local services we are offering peers during node connection. ...
bool IsPeerAddrLocalGood(CNode *pnode)
std::function< void(CNode *)> NodeFn
NetEventsInterface * m_msgproc
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
void SocketHandlerListening(const Sock::EventsPerSock &events_per_sock)
Accept incoming connections, one from each read-ready listening socket.
A combination of a network address (CNetAddr) and a (TCP) port.
Transport protocol agnostic message container.
std::vector< std::string > vSeedNodes
std::vector< std::string > m_specified_outgoing
bool m_bip152_highbandwidth_from
void prepareForTransport(CSerializedNetMsg &msg, std::vector< unsigned char > &header) const override
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(m_total_bytes_sent_mutex)
void OpenNetworkConnection(const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *strDest, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
std::unique_ptr< CSemaphore > semOutbound
std::thread threadMessageHandler
static const int NUM_FDS_MESSAGE_CAPTURE
Number of file descriptors required for message capture.
bool AddConnection(const std::string &address, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
Attempts to open a connection.
const uint256 & GetMessageHash() const
~NetEventsInterface()=default
Protected destructor so that instances can only be deleted by derived classes.
bool IsManualConn() const
virtual void FinalizeNode(const CNode &node)=0
Handle removal of a peer (clear state)
int GetExtraFullOutboundCount() const
std::chrono::microseconds m_last_ping_time
A CService with information about it as peer.
std::chrono::seconds m_last_tx_time
std::vector< CAddress > GetCurrentBlockRelayOnlyConns() const
Return vector of current BLOCK_RELAY peers.
static constexpr bool DEFAULT_FIXEDSEEDS
std::map< CNetAddr, LocalServiceInfo > mapLocalHost GUARDED_BY(g_maplocalhost_mutex)
static CService ip(uint32_t i)
bool m_bip152_highbandwidth_to
bool ExpectServicesFromConn() const
std::atomic_bool m_try_another_outbound_peer
flag for deciding to connect to an extra outbound peer, in excess of m_max_outbound_full_relay This t...
bool InitBinds(const Options &options)
void SetNetworkActive(bool active)
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS
The maximum number of peer connections to maintain.
bool GetNetworkActive() const
static constexpr bool DEFAULT_DNSSEED
std::atomic< bool > m_bip152_highbandwidth_to
const NetPermissionFlags m_permission_flags
std::chrono::seconds m_last_send
CSipHasher GetDeterministicRandomizer(uint64_t id) const
Get a unique deterministic randomizer.
const bool m_inbound_onion
Whether this peer is an inbound onion, i.e. connected via our Tor onion service.
void PongReceived(std::chrono::microseconds ping_time)
A ping-pong round trip has completed successfully.
std::atomic_bool fDisconnect
void CreateNodeFromAcceptedSocket(std::unique_ptr< Sock > &&sock, NetPermissionFlags permission_flags, const CAddress &addr_bind, const CAddress &addr)
Create a CNode object from a socket that has just been accepted and add the node to the m_nodes membe...
void AddAddrFetch(const std::string &strDest) EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex)
The TransportSerializer prepares messages for the network transport.
std::atomic< std::chrono::seconds > m_last_tx_time
UNIX epoch time of the last transaction received from this peer that we had not yet seen (e...
mapMsgTypeSize mapRecvBytesPerMsgType
#define Assume(val)
Assume is the identity function.
uint64_t nRecvBytes GUARDED_BY(cs_vRecv)
RecursiveMutex m_nodes_mutex
void Discover()
Look up IP addresses from all interfaces on the machine and add them to the list of local addresses t...
unsigned int GetReceiveFloodSize() const
void DeleteNode(CNode *pnode)
std::unique_ptr< i2p::sam::Session > m_i2p_sam_session
I2P SAM session.
NetPermissionFlags m_permissions
bool CheckIncomingNonce(uint64_t nonce)
void CloseSocketDisconnect() EXCLUSIVE_LOCKS_REQUIRED(!m_sock_mutex)
void ThreadOpenConnections(std::vector< std::string > connect) EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex
std::atomic< int > nRefCount
bool Complete() const override
void ThreadOpenAddedConnections() EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex
bool IsBlockOnlyConn() const
virtual ~TransportSerializer()
Mutex m_addr_fetches_mutex
std::atomic< std::chrono::seconds > m_last_send
std::atomic< NodeId > nLastNodeId
std::chrono::seconds GetMaxOutboundTimeLeftInCycle() const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
void RemoveLocal(const CService &addr)
std::vector< NetWhitelistPermissions > vWhitelistedRange
std::vector< CService > onion_binds
size_t GetNodeCount(ConnectionDirection) const
void ThreadSocketHandler() EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex
uint32_t m_raw_message_size
used wire size of the message (including header/checksum)
void Shuffle(I first, I last, R &&rng)
More efficient than using std::shuffle on a FastRandomContext.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
static const bool DEFAULT_WHITELISTFORCERELAY
Default for -whitelistforcerelay.
void WakeMessageHandler() EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
BanMan * m_banman
Pointer to this node's banman.
void PushMessage(CNode *pnode, CSerializedNetMsg &&msg) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
static const size_t DEFAULT_MAXSENDBUFFER
std::thread threadOpenConnections
bool AttemptToEvictConnection()
Try to find a connection to evict when the node is full.
uint64_t GetTotalBytesSent() const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
std::chrono::seconds m_peer_connect_timeout
int readHeader(Span< const uint8_t > msg_bytes)
CSemaphoreGrant grantOutbound
CNode * ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
The TransportDeserializer takes care of holding and deserializing the network receive buffer...
const CChainParams & m_chain_params
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.
CConnman(uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, bool network_active=true)
std::atomic< std::chrono::seconds > m_last_recv
bool fAddressesInitialized
std::thread threadDNSAddressSeed
ServiceFlags nLocalServices
uint64_t nMaxOutboundLimit
bool Start(CScheduler &scheduler, const Options &options) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex
std::vector< std::string > m_added_nodes
std::vector< ListenSocket > vhListenSocket
std::chrono::seconds GetMaxOutboundTimeframe() const
std::atomic< int > m_greatest_common_version
CService GetAddrLocal() const EXCLUSIVE_LOCKS_REQUIRED(!m_addr_local_mutex)
std::atomic< int64_t > nTimeOffset
size_t nSendOffset GUARDED_BY(cs_vSend)
Offset inside the first vSendMsg already sent.
std::chrono::seconds m_last_block_time
static constexpr bool DEFAULT_FORCEDNSSEED
const std::unique_ptr< const TransportSerializer > m_serializer
std::atomic_bool fSuccessfullyConnected
fSuccessfullyConnected is set to true on receiving VERACK from the peer.
#define AssertLockNotHeld(cs)
static const unsigned int MAX_SUBVERSION_LENGTH
Maximum length of the user agent string in version message.
static constexpr auto FEELER_INTERVAL
Run the feeler connection loop once every 2 minutes.
std::atomic< int > nVersion
Sock::EventsPerSock GenerateWaitSockets(Span< CNode *const > nodes)
Generate a collection of sockets to check for IO readiness.
static const int64_t DEFAULT_PEER_CONNECT_TIMEOUT
-peertimeout default
const std::string NET_MESSAGE_TYPE_OTHER
static constexpr auto EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL
Run the extra block-relay-only connection loop once every 5 minutes.
uint64_t nTotalBytesSent GUARDED_BY(m_total_bytes_sent_mutex)
std::string ConnectionTypeAsString() const
ConnectionType
Different types of connections to a peer.
static const bool DEFAULT_BLOCKSONLY
Default for blocks only.
bool ShouldRunInactivityChecks(const CNode &node, std::chrono::seconds now) const
Return true if we should disconnect the peer for failing an inactivity check.
const uint64_t nLocalHostNonce
unsigned int nSendBufferMaxSize
std::atomic< bool > m_bip152_highbandwidth_from
void ThreadI2PAcceptIncoming()
RAII helper class that manages a socket.
std::vector< CNode * > m_nodes_copy
CNode(NodeId id, std::shared_ptr< Sock > sock, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn, ConnectionType conn_type_in, bool inbound_onion, CNodeOptions &&node_opts={})
bool IsAddrFetchConn() const
static const bool DEFAULT_WHITELISTRELAY
Default for -whitelistrelay.
RAII helper to atomically create a copy of m_nodes and add a reference to each of the nodes...
static const int MAX_OUTBOUND_FULL_RELAY_CONNECTIONS
Maximum number of automatic outgoing nodes over which we'll relay everything (blocks, tx, addrs, etc)
void ThreadMessageHandler() EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
void AcceptConnection(const ListenSocket &hListenSocket)
A Span is an object that can refer to a contiguous sequence of objects.
std::string strSubVersion
Subversion as sent to the P2P network in version messages.
Different type to mark Mutex at global scope.
NodesSnapshot(const CConnman &connman, bool shuffle)
Information about a peer.
std::atomic< std::chrono::seconds > m_last_block_time
UNIX epoch time of the last block received from this peer that we had not yet seen (e...
void ForEachNode(const NodeFn &func)
std::thread threadSocketHandler
Simple class for background tasks that should be run periodically or once "after a while"...
void SetReachable(enum Network net, bool reachable)
Mark a network as reachable or unreachable (no automatic connects to it)
virtual bool Complete() const =0
std::atomic< std::chrono::microseconds > m_last_ping_time
Last measured round-trip time.
Network ConnectedThroughNetwork() const
Get network the peer connected through.
V1TransportDeserializer(const CChainParams &chain_params, const NodeId node_id, int nTypeIn, int nVersionIn)
std::chrono::microseconds m_time
time of message receipt
std::vector< CAddress > m_anchors
Addresses that were saved during the previous clean shutdown.
std::atomic< std::chrono::microseconds > m_min_ping_time
Lowest measured round-trip time.
const NetGroupManager & m_netgroupman
std::atomic< uint64_t > nTotalBytesRecv
int GetCommonVersion() const
CSerializedNetMsg & operator=(CSerializedNetMsg &&)=default
const std::string m_addr_name
std::atomic_bool fPauseRecv
std::unique_ptr< CSemaphore > semAddnode
CThreadInterrupt interruptNet
This is signaled when network activity should cease.
bool HasPermission(NetPermissionFlags permission) const
virtual void SetVersion(int version)=0
bool AddLocal(const CService &addr, int nScore=LOCAL_NONE)
bool IsInboundConn() const
bool m_use_addrman_outgoing
std::vector< NetWhitebindPermissions > vWhiteBinds
bool IsLocal(const CService &addr)
check whether a given address is potentially local
size_t nSendSize GUARDED_BY(cs_vSend)
Total size of all vSendMsg entries.
const std::vector< CNode * > & Nodes() const
std::unique_ptr< i2p::sam::Session > i2p_sam_session
bool GetUseAddrmanOutgoing() const
bool bind_on_any
True if the user did not specify -bind= or -whitebind= and thus we should bind on 0...
virtual CNetMessage GetMessage(std::chrono::microseconds time, bool &reject_message)=0
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 respons...
m_max_outbound_full_relay
bool m_use_addrman_outgoing
Cache responses to addr requests to minimize privacy leak.
virtual bool ProcessMessages(CNode *pnode, std::atomic< bool > &interrupt)=0
Process protocol messages received from a given node.
bool IsFullOutboundConn() const
void CaptureMessageToFile(const CAddress &addr, const std::string &msg_type, Span< const unsigned char > data, bool is_incoming)
Dump binary message to file, with timestamp.
We use block-relay-only connections to help prevent against partition attacks.
void CopyStats(CNodeStats &stats) EXCLUSIVE_LOCKS_REQUIRED(!m_subver_mutex
CClientUIInterface * m_client_interface
virtual bool SendMessages(CNode *pnode) EXCLUSIVE_LOCKS_REQUIRED(pnode -> cs_sendProcessing)=0
Send queued protocol messages to a given node.
static const std::string DEFAULT_MAX_UPLOAD_TARGET
The default for -maxuploadtarget.
int64_t m_peer_connect_timeout
std::string cleanSubVer GUARDED_BY(m_subver_mutex)
cleanSubVer is a sanitized string of the user agent byte array we read from the wire.