36 #include <condition_variable>
130 "outbound-full-relay (default automatic connections)",
131 "block-relay-only (does not relay transactions or addresses)",
132 "inbound (initiated by the peer)",
133 "manual (added via addnode RPC or -addnode/-connect configuration options)",
134 "addr-fetch (short-lived automatic connection for soliciting addresses)",
135 "feeler (short-lived automatic connection for testing addresses)"};
262 extern std::map<CNetAddr, LocalServiceInfo>
353 std::chrono::microseconds time) = 0;
392 :
hdrbuf(nTypeIn, nVersionIn),
hdr(pchMessageStartIn),
393 vRecv(nTypeIn, nVersionIn) {
414 msg_bytes = msg_bytes.
subspan(ret);
420 std::chrono::microseconds time)
override;
432 std::vector<uint8_t> &header) = 0;
439 std::vector<uint8_t> &header)
override;
626 std::set<avalanche::ProofId>
710 std::chrono::microseconds::max()};
713 const CAddress &addrIn, uint64_t nKeyedNetGroupIn,
714 uint64_t nLocalHostNonceIn, uint64_t nLocalExtraEntropyIn,
715 const CAddress &addrBindIn,
const std::string &addrNameIn,
772 m_tx_relay->filterInventoryKnown.insert(txid);
781 if (!
m_tx_relay->filterInventoryKnown.contains(txid)) {
782 m_tx_relay->setInventoryTxToSend.insert(txid);
881 std::atomic<bool> &interrupt) = 0;
984 AddrMan &addrmanIn,
bool network_active =
true);
1012 for (
auto &&
node : m_nodes) {
1021 for (
auto &&
node : m_nodes) {
1039 std::vector<CAddress>
GetAddresses(
size_t max_addresses,
size_t max_pct,
1040 std::optional<Network> network)
const;
1091 void GetNodeStats(std::vector<CNodeStats> &vstats)
const;
1136 std::chrono::microseconds
1138 std::chrono::seconds average_interval);
1145 std::chrono::seconds now)
const;
1173 mockOpenConnection);
1196 std::set<SOCKET> &send_set,
1197 std::set<SOCKET> &error_set);
1198 void SocketEvents(std::set<SOCKET> &recv_set, std::set<SOCKET> &send_set,
1199 std::set<SOCKET> &error_set);
1252 std::chrono::seconds
1406 friend struct ::CConnmanTest;
1414 std::chrono::microseconds
1416 std::chrono::seconds average_interval);
1449 [[nodiscard]] std::optional<NodeId>
1475 std::vector<NodeEvictionCandidate> &vEvictionCandidates);
RecursiveMutex cs_main
Global state.
#define Assume(val)
Assume is the identity function.
Stochastic address manager.
A CService with information about it as peer.
Signals for UI communication.
void CreateNodeFromAcceptedSocket(SOCKET hSocket, NetPermissionFlags permissionFlags, 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...
std::condition_variable condMsgProc
size_t GetNodeCount(NumConnections num) const
uint64_t nTotalBytesSent GUARDED_BY(cs_totalBytesSent)
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent)
std::thread threadMessageHandler
void ForEachNode(const NodeFn &func)
std::chrono::seconds GetMaxOutboundTimeLeftInCycle() const
returns the time in second left in the current max outbound cycle in case of no limit,...
void ThreadOpenAddedConnections()
bool OutboundTargetReached(bool historicalBlockServingLimit) const
check if the outbound target is reached.
CClientUIInterface * m_client_interface
size_t SocketSendData(CNode &node) const EXCLUSIVE_LOCKS_REQUIRED(node.cs_vSend)
void ForEachNode(const NodeFn &func) const
bool ForNode(NodeId id, std::function< bool(CNode *pnode)> func)
std::vector< AddedNodeInfo > GetAddedNodeInfo() const
bool AddConnection(const std::string &address, ConnectionType conn_type)
Attempts to open a connection.
CNode * ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type)
void DeleteNode(CNode *pnode)
bool AttemptToEvictConnection()
Try to find a connection to evict when the node is full.
bool GetNetworkActive() const
bool AlreadyConnectedToAddress(const CAddress &addr)
Determine whether we're already connected to a given address, in order to avoid initiating duplicate ...
void AddAddrFetch(const std::string &strDest)
ServiceFlags nLocalServices
Services this instance offers.
bool GetTryNewOutboundPeer() const
int m_max_outbound_block_relay
std::thread threadI2PAcceptIncoming
void SetTryNewOutboundPeer(bool flag)
std::atomic< bool > flagInterruptMsgProc
unsigned int GetReceiveFloodSize() const
void SocketEvents(std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set)
CThreadInterrupt interruptNet
This is signaled when network activity should cease.
std::unique_ptr< CSemaphore > semAddnode
std::atomic< NodeId > nLastNodeId
std::atomic< std::chrono::microseconds > m_next_send_inv_to_incoming
void RecordBytesSent(uint64_t bytes)
bool fMsgProcWake GUARDED_BY(mutexMsgProc)
flag for waking the message processor.
std::vector< std::string > m_added_nodes GUARDED_BY(m_added_nodes_mutex)
int GetExtraBlockRelayCount() const
BanMan * m_banman
Pointer to this node's banman.
uint64_t GetOutboundTargetBytesLeft() const
response the bytes left in the current max outbound cycle in case of no limit, it will always respons...
std::thread threadDNSAddressSeed
void ThreadOpenConnections(std::vector< std::string > connect, std::function< void(const CAddress &, ConnectionType)> mockOpenConnection)
void ThreadI2PAcceptIncoming()
void StartExtraBlockRelayPeers()
std::vector< CAddress > m_anchors
Addresses that were saved during the previous clean shutdown.
std::chrono::seconds GetMaxOutboundTimeframe() const
friend struct ConnmanTestMsg
unsigned int nPrevNodeCount
void NotifyNumConnectionsChanged()
ServiceFlags GetLocalServices() const
Used to convey which local services we are offering peers during node connection.
bool DisconnectNode(const std::string &node)
std::chrono::seconds m_peer_connect_timeout
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.
bool InitBinds(const Options &options)
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent)
std::vector< ListenSocket > vhListenSocket
std::vector< CAddress > GetCurrentBlockRelayOnlyConns() const
Return vector of current BLOCK_RELAY peers.
CSipHasher GetDeterministicRandomizer(uint64_t id) const
Get a unique deterministic randomizer.
uint64_t GetMaxOutboundTarget() const
std::unique_ptr< CSemaphore > semOutbound
std::vector< NetWhitelistPermissions > vWhitelistedRange
void ThreadSocketHandler()
RecursiveMutex cs_totalBytesSent
bool Bind(const CService &addr, unsigned int flags, NetPermissionFlags permissions)
std::thread threadOpenConnections
Mutex m_addr_fetches_mutex
bool InactivityCheck(const CNode &node) const
Return true if the peer is inactive and should be disconnected.
CNode * FindNode(const CNetAddr &ip)
void Init(const Options &connOptions)
void GetNodeStats(std::vector< CNodeStats > &vstats) const
const uint64_t nSeed0
SipHasher seeds for deterministic randomness.
unsigned int nReceiveFloodSize
int GetExtraFullOutboundCount() const
uint64_t GetTotalBytesRecv() const
RecursiveMutex m_nodes_mutex
static bool NodeFullyConnected(const CNode *pnode)
CConnman(const Config &configIn, uint64_t seed0, uint64_t seed1, AddrMan &addrmanIn, bool network_active=true)
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.
std::deque< std::string > m_addr_fetches GUARDED_BY(m_addr_fetches_mutex)
std::function< void(CNode *)> NodeFn
void WakeMessageHandler()
void SetNetworkActive(bool active)
std::list< CNode * > m_nodes_disconnected
void OpenNetworkConnection(const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *strDest, ConnectionType conn_type)
void AddWhitelistPermissionFlags(NetPermissionFlags &flags, const CNetAddr &addr) const
bool Start(CScheduler &scheduler, const Options &options)
bool GenerateSelectSet(std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set)
void ThreadDNSAddressSeed()
void ThreadMessageHandler()
uint64_t CalculateKeyedNetGroup(const CAddress &ad) const
bool fAddressesInitialized
std::chrono::microseconds PoissonNextSendInbound(std::chrono::microseconds now, std::chrono::seconds average_interval)
Attempts to obfuscate tx time through exponentially distributed emitting.
std::thread threadOpenAddedConnections
Mutex m_added_nodes_mutex
std::vector< CNode * > m_nodes GUARDED_BY(m_nodes_mutex)
bool CheckIncomingNonce(uint64_t nonce)
int m_max_outbound_full_relay
void RecordBytesRecv(uint64_t bytes)
bool ShouldRunInactivityChecks(const CNode &node, std::chrono::seconds now) const
Return true if we should disconnect the peer for failing an inactivity check.
void PushMessage(CNode *pnode, CSerializedNetMsg &&msg)
bool GetUseAddrmanOutgoing() const
unsigned int nSendBufferMaxSize
std::unique_ptr< i2p::sam::Session > m_i2p_sam_session
I2P SAM session.
bool m_use_addrman_outgoing
std::map< uint64_t, CachedAddrResponse > m_addr_response_caches
Addr responses stored in different caches per (network, local socket) prevent cross-network node iden...
uint64_t nMaxOutboundLimit GUARDED_BY(cs_totalBytesSent)
std::atomic< uint64_t > nTotalBytesRecv
std::atomic< bool > fNetworkActive
std::atomic_bool m_start_extra_block_relay_peers
flag for initiating extra block-relay-only peer connections.
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...
bool AddNode(const std::string &node)
std::vector< NetEventsInterface * > m_msgproc
std::thread threadSocketHandler
uint64_t GetTotalBytesSent() const
bool RemoveAddedNode(const std::string &node)
void AcceptConnection(const ListenSocket &hListenSocket)
bool BindListenPort(const CService &bindAddr, bilingual_str &strError, NetPermissionFlags permissions)
int m_max_avalanche_outbound
Double ended buffer combining vector and stream-like interfaces.
void resize(size_type n, value_type c=0)
A hasher class for Bitcoin's 256-bit hash (double SHA-256).
Transport protocol agnostic message container.
CNetMessage(CDataStream &&recv_in)
uint32_t m_message_size
size of the payload
std::chrono::microseconds m_time
time of message receipt
CDataStream m_recv
received message data
void SetVersion(int nVersionIn)
uint32_t m_raw_message_size
used wire size of the message (including header/checksum)
Information about a peer.
RecursiveMutex cs_vProcessMsg
Mutex cs_avalanche_pubkey
bool IsFeelerConn() const
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend)
const std::chrono::seconds m_connected
Unix epoch time at peer connection.
bool ExpectServicesFromConn() const
std::atomic< int > nVersion
uint64_t nRecvBytes GUARDED_BY(cs_vRecv)
std::atomic< double > availabilityScore
The last computed score.
bool IsInboundConn() const
bool HasPermission(NetPermissionFlags permission) const
std::atomic_bool fPauseRecv
bool IsOutboundOrBlockRelayConn() const
bool IsManualConn() const
std::atomic< int64_t > nTimeOffset
RecursiveMutex cs_sendProcessing
const std::string m_addr_name
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv)
std::string ConnectionTypeAsString() const
std::deque< std::vector< uint8_t > > vSendMsg GUARDED_BY(cs_vSend)
void SetCommonVersion(int greatest_common_version)
std::atomic< bool > m_bip152_highbandwidth_to
const std::unique_ptr< TxRelay > m_tx_relay
std::list< CNetMessage > vRecvMsg
void SetAddrLocal(const CService &addrLocalIn)
May not be called more than once.
std::atomic< bool > m_bip152_highbandwidth_from
void PongReceived(std::chrono::microseconds ping_time)
A ping-pong round trip has completed successfully.
std::atomic_bool fSuccessfullyConnected
bool IsAddrFetchConn() const
uint64_t GetLocalNonce() const
std::atomic< ServiceFlags > nServices
RecursiveMutex cs_addrLocal
CSemaphoreGrant grantOutbound
const uint64_t nKeyedNetGroup
friend struct ConnmanTestMsg
std::atomic< int > nRefCount
std::atomic< int > m_greatest_common_version
bool IsBlockOnlyConn() const
void CloseSocketDisconnect()
const std::unique_ptr< ProofRelay > m_proof_relay
int GetCommonVersion() const
bool IsFullOutboundConn() const
uint64_t nRemoteHostNonce
std::unique_ptr< TransportSerializer > m_serializer
Mutex m_subver_mutex
cleanSubVer is a sanitized string of the user agent byte array we read from the wire.
std::atomic_bool fPauseSend
SOCKET hSocket GUARDED_BY(cs_hSocket)
std::chrono::seconds m_nextGetAvaAddr
uint64_t nRemoteExtraEntropy
uint64_t GetLocalExtraEntropy() const
std::list< CNetMessage > vProcessMsg GUARDED_BY(cs_vProcessMsg)
const ServiceFlags nLocalServices
Services offered to this peer.
void PushProofInventory(const avalanche::ProofId &proofid)
std::optional< CPubKey > m_avalanche_pubkey GUARDED_BY(cs_avalanche_pubkey)
void AddKnownTx(const TxId &txid)
std::unique_ptr< TransportDeserializer > m_deserializer
double getAvailabilityScore() const
size_t nSendOffset GUARDED_BY(cs_vSend)
Offset inside the first vSendMsg already sent.
NetPermissionFlags m_permissionFlags
const ConnectionType m_conn_type
Network ConnectedThroughNetwork() const
Get network the peer connected through.
CService addrLocal GUARDED_BY(cs_addrLocal)
const uint64_t nLocalHostNonce
std::atomic< std::chrono::microseconds > m_last_ping_time
Last measured round-trip time.
void updateAvailabilityScore(double decayFactor)
The availability score is calculated using an exponentially weighted average.
size_t nSendSize GUARDED_BY(cs_vSend)
Total size of all vSendMsg entries.
void copyStats(CNodeStats &stats)
ServiceFlags GetLocalServices() const
const uint64_t nLocalExtraEntropy
void invsPolled(uint32_t count)
The node was polled for count invs.
CNode(const CNode &)=delete
const bool m_inbound_onion
Whether this peer is an inbound onion, i.e.
std::atomic< std::chrono::microseconds > m_min_ping_time
Lowest measured round-trip time.
std::atomic< std::chrono::seconds > m_last_proof_time
UNIX epoch time of the last proof received from this peer that we had not yet seen (e....
std::atomic< bool > m_avalanche_enabled
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....
uint64_t nSendBytes GUARDED_BY(cs_vSend)
std::atomic< uint64_t > invCounters
The inventories polled and voted counters since last score computation, stored as a pair of uint32_t ...
bool ReceiveMsgBytes(const Config &config, Span< const uint8_t > msg_bytes, bool &complete)
Receive bytes from the buffer and deserialize them into messages.
void PushTxInventory(const TxId &txid)
std::atomic_bool fDisconnect
std::atomic< std::chrono::seconds > m_last_recv
void AddKnownProof(const avalanche::ProofId &proofid)
CNode(NodeId id, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, uint64_t nLocalExtraEntropyIn, const CAddress &addrBindIn, const std::string &addrNameIn, ConnectionType conn_type_in, bool inbound_onion)
CService GetAddrLocal() const
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....
void invsVoted(uint32_t count)
The node voted for count invs.
std::atomic< std::chrono::seconds > m_last_send
bool IsAvalancheOutboundConnection() const
CNode & operator=(const CNode &)=delete
std::string cleanSubVer GUARDED_BY(m_subver_mutex)
RollingBloomFilter is a probabilistic "keep track of most recently inserted" set.
Simple class for background tasks that should be run periodically or once "after a while".
RAII-style semaphore lock.
A combination of a network address (CNetAddr) and a (TCP) port.
A helper class for interruptible sleeps.
Interface for message handling.
virtual void InitializeNode(const Config &config, CNode *pnode)=0
Initialize a peer (setup state, queue any initial messages)
virtual bool SendMessages(const Config &config, CNode *pnode) EXCLUSIVE_LOCKS_REQUIRED(pnode -> cs_sendProcessing)=0
Send queued protocol messages to a given node.
~NetEventsInterface()=default
Protected destructor so that instances can only be deleted by derived classes.
virtual void FinalizeNode(const Config &config, const CNode &node)=0
Handle removal of a peer (clear state)
virtual bool ProcessMessages(const Config &config, CNode *pnode, std::atomic< bool > &interrupt)=0
Process protocol messages received from a given node.
static void AddFlag(NetPermissionFlags &flags, NetPermissionFlags f)
static bool HasFlag(NetPermissionFlags flags, NetPermissionFlags f)
A Span is an object that can refer to a contiguous sequence of objects.
CONSTEXPR_IF_NOT_DEBUG Span< C > subspan(std::size_t offset) const noexcept
The TransportDeserializer takes care of holding and deserializing the network receive buffer.
virtual ~TransportDeserializer()
virtual bool Complete() const =0
virtual CNetMessage GetMessage(const Config &config, std::chrono::microseconds time)=0
virtual void SetVersion(int version)=0
virtual int Read(const Config &config, Span< const uint8_t > &msg_bytes)=0
read and deserialize data, advances msg_bytes data pointer
The TransportSerializer prepares messages for the network transport.
virtual void prepareForTransport(const Config &config, CSerializedNetMsg &msg, std::vector< uint8_t > &header)=0
virtual ~TransportSerializer()
CNetMessage GetMessage(const Config &config, std::chrono::microseconds time) override
const uint256 & GetMessageHash() const
int Read(const Config &config, Span< const uint8_t > &msg_bytes) override
read and deserialize data, advances msg_bytes data pointer
void SetVersion(int nVersionIn) override
int readData(Span< const uint8_t > msg_bytes)
bool Complete() const override
int readHeader(const Config &config, Span< const uint8_t > msg_bytes)
V1TransportDeserializer(const CMessageHeader::MessageMagic &pchMessageStartIn, int nTypeIn, int nVersionIn)
void prepareForTransport(const Config &config, CSerializedNetMsg &msg, std::vector< uint8_t > &header) override
#define LogPrint(category,...)
CAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices)
bool IsPeerAddrLocalGood(CNode *pnode)
const std::vector< std::string > CONNECTION_TYPE_DOC
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS
The maximum number of peer connections to maintain.
bool IsLocal(const CService &addr)
check whether a given address is potentially local
void RemoveLocal(const CService &addr)
static const unsigned int MAX_SUBVERSION_LENGTH
Maximum length of the user agent string in version message.
static constexpr std::chrono::minutes TIMEOUT_INTERVAL
Time after which to disconnect, after waiting for a ping response (or inactivity).
static const int MAX_ADDNODE_CONNECTIONS
Maximum number of addnode outgoing nodes.
bool AddLocal(const CService &addr, int nScore=LOCAL_NONE)
static const size_t DEFAULT_MAXSENDBUFFER
static const int NUM_FDS_MESSAGE_CAPTURE
Number of file descriptors required for message capture.
static const bool DEFAULT_BLOCKSONLY
Default for blocks only.
static const bool DEFAULT_WHITELISTFORCERELAY
Default for -whitelistforcerelay.
static const bool DEFAULT_FORCEDNSSEED
static const bool DEFAULT_WHITELISTRELAY
Default for -whitelistrelay.
RecursiveMutex cs_mapLocalHost
static constexpr uint64_t DEFAULT_MAX_UPLOAD_TARGET
The default for -maxuploadtarget.
static constexpr auto EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL
Run the extra block-relay-only connection loop once every 5 minutes.
static const size_t DEFAULT_MAXRECEIVEBUFFER
const std::string NET_MESSAGE_COMMAND_OTHER
static const int DEFAULT_MAX_AVALANCHE_OUTBOUND_CONNECTIONS
Maximum number of avalanche enabled outgoing connections by default.
void SetReachable(enum Network net, bool reachable)
Mark a network as reachable or unreachable (no automatic connects to it)
static const bool DEFAULT_FIXEDSEEDS
ConnectionType
Different types of connections to a peer.
@ BLOCK_RELAY
We use block-relay-only connections to help prevent against partition attacks.
@ MANUAL
We open manual connections to addresses that users explicitly inputted via the addnode RPC,...
@ OUTBOUND_FULL_RELAY
These are the default connections that we use to connect with the network.
@ FEELER
Feeler connections are short-lived connections made to check that a node is alive.
@ INBOUND
Inbound connections are those initiated by a peer.
@ AVALANCHE_OUTBOUND
Special case of connection to a full relay outbound with avalanche service enabled.
@ ADDR_FETCH
AddrFetch connections are short lived connections used to solicit addresses from peers.
std::map< CNetAddr, LocalServiceInfo > mapLocalHost GUARDED_BY(cs_mapLocalHost)
std::map< std::string, uint64_t > mapMsgCmdSize
std::string getSubVersionEB(uint64_t MaxBlockSize)
This function convert MaxBlockSize from byte to MB with a decimal precision one digit rounded down E....
static const int MAX_FEELER_CONNECTIONS
Maximum number of feeler connections.
static const bool DEFAULT_LISTEN
-listen default
bool GetLocal(CService &addr, const CNetAddr *paddrPeer=nullptr)
static constexpr auto FEELER_INTERVAL
Run the feeler connection loop once every 2 minutes.
static const int64_t DEFAULT_PEER_CONNECT_TIMEOUT
-peertimeout default
std::optional< NodeId > SelectNodeToEvict(std::vector< NodeEvictionCandidate > &&vEvictionCandidates)
Select an inbound peer to evict after filtering out (protecting) peers having distinct,...
void ProtectEvictionCandidatesByRatio(std::vector< NodeEvictionCandidate > &vEvictionCandidates)
Protect desirable or disadvantaged inbound peers from eviction by ratio.
std::optional< CAddress > GetLocalAddrForPeer(CNode *pnode)
Returns a local address that we should advertise to this peer.
static const bool DEFAULT_DNSSEED
static const int MAX_OUTBOUND_FULL_RELAY_CONNECTIONS
Maximum number of automatic outgoing nodes over which we'll relay everything (blocks,...
std::string ConnectionTypeAsString(ConnectionType conn_type)
Convert ConnectionType enum to a string value.
void CaptureMessage(const CAddress &addr, const std::string &msg_type, const Span< const uint8_t > &data, bool is_incoming)
Dump binary message to file, with timestamp.
std::string userAgent(const Config &config)
static const int MAX_BLOCK_RELAY_ONLY_CONNECTIONS
Maximum number of block-relay-only outgoing connections.
bool IsReachable(enum Network net)
bool SeenLocal(const CService &addr)
vote for a local address
std::chrono::microseconds PoissonNextSend(std::chrono::microseconds now, std::chrono::seconds average_interval)
Return a timestamp in the future (in microseconds) for exponentially distributed events.
ServiceFlags
nServices flags.
static constexpr Amount zero()
Cache responses to addr requests to minimize privacy leak.
std::chrono::microseconds m_cache_entry_expiration
std::vector< CAddress > m_addrs_response_cache
void AddSocketPermissionFlags(NetPermissionFlags &flags) const
ListenSocket(SOCKET socket_, NetPermissionFlags permissions_)
NetPermissionFlags m_permissions
int m_max_outbound_block_relay
unsigned int nReceiveFloodSize
int m_max_outbound_full_relay
std::vector< NetWhitebindPermissions > vWhiteBinds
uint64_t nMaxOutboundLimit
std::vector< NetWhitelistPermissions > vWhitelistedRange
CClientUIInterface * uiInterface
int m_max_avalanche_outbound
std::vector< CService > onion_binds
std::vector< std::string > m_specified_outgoing
ServiceFlags nLocalServices
std::vector< std::string > m_added_nodes
int64_t m_peer_connect_timeout
std::vector< CService > vBinds
unsigned int nSendBufferMaxSize
bool m_i2p_accept_incoming
std::vector< std::string > vSeedNodes
bool m_use_addrman_outgoing
std::vector< NetEventsInterface * > m_msgproc
bool bind_on_any
True if the user did not specify -bind= or -whitebind= and thus we should bind on 0....
std::set< avalanche::ProofId > setInventoryProofToSend GUARDED_BY(cs_proof_inventory)
std::chrono::microseconds nextInvSend
CRollingBloomFilter filterProofKnown GUARDED_BY(cs_proof_inventory)
RecursiveMutex cs_proof_inventory
std::atomic< bool > compactproofs_requested
std::atomic< std::chrono::seconds > lastSharedProofsUpdate
RadixTree< const avalanche::Proof, avalanche::ProofRadixTreeAdapter > sharedProofs
CRollingBloomFilter filterInventoryKnown GUARDED_BY(cs_tx_inventory)
std::chrono::microseconds m_next_send_feefilter
std::chrono::microseconds nNextInvSend
bool fSendMempool GUARDED_BY(cs_tx_inventory)
std::set< TxId > setInventoryTxToSend GUARDED_BY(cs_tx_inventory)
std::atomic< std::chrono::seconds > m_last_mempool_req
bool fRelayTxes GUARDED_BY(cs_filter)
RecursiveMutex cs_tx_inventory
std::unique_ptr< CBloomFilter > pfilter PT_GUARDED_BY(cs_filter) GUARDED_BY(cs_filter)
std::atomic< Amount > minFeeFilter
Minimum fee rate with which to filter inv's to this node.
POD that contains various stats about a node.
mapMsgCmdSize mapSendBytesPerMsgCmd
std::chrono::microseconds m_last_ping_time
std::chrono::seconds m_last_recv
std::optional< double > m_availabilityScore
std::chrono::seconds m_last_proof_time
ConnectionType m_conn_type
std::chrono::seconds m_last_send
std::chrono::seconds m_last_tx_time
std::chrono::microseconds m_min_ping_time
std::chrono::seconds m_connected
bool m_bip152_highbandwidth_from
bool m_bip152_highbandwidth_to
mapMsgCmdSize mapRecvBytesPerMsgCmd
std::chrono::seconds m_last_block_time
NetPermissionFlags m_permissionFlags
CSerializedNetMsg(const CSerializedNetMsg &msg)=delete
std::vector< uint8_t > data
CSerializedNetMsg & operator=(const CSerializedNetMsg &)=delete
CSerializedNetMsg()=default
CSerializedNetMsg(CSerializedNetMsg &&)=default
CSerializedNetMsg & operator=(CSerializedNetMsg &&)=default
std::chrono::seconds m_last_tx_time
std::chrono::seconds m_connected
std::chrono::seconds m_last_block_time
std::chrono::microseconds m_min_ping_time
std::chrono::seconds m_last_proof_time
A TxId is the identifier of a transaction.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation