Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
| Show First 20 Lines • Show All 1,078 Lines • ▼ Show 20 Lines | public: | ||||
| /** | /** | ||||
| * Return true if we should disconnect the peer for failing an inactivity | * Return true if we should disconnect the peer for failing an inactivity | ||||
| * check. | * check. | ||||
| */ | */ | ||||
| bool ShouldRunInactivityChecks(const CNode &node, | bool ShouldRunInactivityChecks(const CNode &node, | ||||
| std::chrono::seconds now) const; | std::chrono::seconds now) const; | ||||
| void SetQuorumEstablished(bool quorum_established) { | |||||
| m_quorum_established = quorum_established; | |||||
| } | |||||
| private: | private: | ||||
| struct ListenSocket { | struct ListenSocket { | ||||
| public: | public: | ||||
| std::shared_ptr<Sock> sock; | std::shared_ptr<Sock> sock; | ||||
| inline void AddSocketPermissionFlags(NetPermissionFlags &flags) const { | inline void AddSocketPermissionFlags(NetPermissionFlags &flags) const { | ||||
| NetPermissions::AddFlag(flags, m_permissions); | NetPermissions::AddFlag(flags, m_permissions); | ||||
| } | } | ||||
| ListenSocket(std::shared_ptr<Sock> sock_, | ListenSocket(std::shared_ptr<Sock> sock_, | ||||
| ▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | private: | ||||
| * flag for adding 'relay' permission to whitelisted inbound | * flag for adding 'relay' permission to whitelisted inbound | ||||
| * and manual peers with default permissions. | * and manual peers with default permissions. | ||||
| */ | */ | ||||
| bool whitelist_relay; | bool whitelist_relay; | ||||
| std::atomic_bool inflight_throttle{false}; | std::atomic_bool inflight_throttle{false}; | ||||
| /** | /** | ||||
| * flag for indicating if a quorum of avalanche peers has been established. | |||||
| * This indicates we can be less aggressive with our avalanche outbound | |||||
| * peer selection. | |||||
| */ | |||||
| std::atomic_bool m_quorum_established{false}; | |||||
| /** | |||||
| * RAII helper to atomically create a copy of `m_nodes` and add a reference | * RAII helper to atomically create a copy of `m_nodes` and add a reference | ||||
| * to each of the nodes. The nodes are released when this object is | * to each of the nodes. The nodes are released when this object is | ||||
| * destroyed. | * destroyed. | ||||
| */ | */ | ||||
| class NodesSnapshot { | class NodesSnapshot { | ||||
| public: | public: | ||||
| explicit NodesSnapshot(const CConnman &connman, bool shuffle) { | explicit NodesSnapshot(const CConnman &connman, bool shuffle) { | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||