net: store -whitelist{force}relay values in CConnman
This commit is contained in:
1 parent
801ef07ebd
commit
2863d7dddb
2 files changed
+18
No files matched your search
@@ -1775,6 +1775,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
connOptions.m_added_nodes = args.GetArgs("-addnode");
|
connOptions.m_added_nodes = args.GetArgs("-addnode");
|
||||||
connOptions.nMaxOutboundLimit = *opt_max_upload;
|
connOptions.nMaxOutboundLimit = *opt_max_upload;
|
||||||
connOptions.m_peer_connect_timeout = peer_connect_timeout;
|
connOptions.m_peer_connect_timeout = peer_connect_timeout;
|
||||||
|
connOptions.whitelist_forcerelay = args.GetBoolArg("-whitelistforcerelay", DEFAULT_WHITELISTFORCERELAY);
|
||||||
|
connOptions.whitelist_relay = args.GetBoolArg("-whitelistrelay", DEFAULT_WHITELISTRELAY);
|
||||||
|
|
||||||
// Port to bind to if `-bind=addr` is provided without a `:port` suffix.
|
// Port to bind to if `-bind=addr` is provided without a `:port` suffix.
|
||||||
const uint16_t default_bind_port =
|
const uint16_t default_bind_port =
|
||||||
|
|||||||
@@ -1064,6 +1064,8 @@ public:
|
|||||||
std::vector<std::string> m_specified_outgoing;
|
std::vector<std::string> m_specified_outgoing;
|
||||||
std::vector<std::string> m_added_nodes;
|
std::vector<std::string> m_added_nodes;
|
||||||
bool m_i2p_accept_incoming;
|
bool m_i2p_accept_incoming;
|
||||||
|
bool whitelist_forcerelay = DEFAULT_WHITELISTFORCERELAY;
|
||||||
|
bool whitelist_relay = DEFAULT_WHITELISTRELAY;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Init(const Options& connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, !m_total_bytes_sent_mutex)
|
void Init(const Options& connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, !m_total_bytes_sent_mutex)
|
||||||
@@ -1098,6 +1100,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_onion_binds = connOptions.onion_binds;
|
m_onion_binds = connOptions.onion_binds;
|
||||||
|
whitelist_forcerelay = connOptions.whitelist_forcerelay;
|
||||||
|
whitelist_relay = connOptions.whitelist_relay;
|
||||||
}
|
}
|
||||||
|
|
||||||
CConnman(uint64_t seed0, uint64_t seed1, AddrMan& addrman, const NetGroupManager& netgroupman,
|
CConnman(uint64_t seed0, uint64_t seed1, AddrMan& addrman, const NetGroupManager& netgroupman,
|
||||||
@@ -1551,6 +1555,18 @@ private:
|
|||||||
*/
|
*/
|
||||||
std::vector<CService> m_onion_binds;
|
std::vector<CService> m_onion_binds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* flag for adding 'forcerelay' permission to whitelisted inbound
|
||||||
|
* and manual peers with default permissions.
|
||||||
|
*/
|
||||||
|
bool whitelist_forcerelay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* flag for adding 'relay' permission to whitelisted inbound
|
||||||
|
* and manual peers with default permissions.
|
||||||
|
*/
|
||||||
|
bool whitelist_relay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mutex protecting m_i2p_sam_sessions.
|
* Mutex protecting m_i2p_sam_sessions.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in new issue
Block a user