mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
net: store -whitelist{force}relay
values in CConnman
This commit is contained in:
parent
801ef07ebd
commit
2863d7dddb
2 changed files with 18 additions and 0 deletions
|
@ -1775,6 +1775,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
connOptions.m_added_nodes = args.GetArgs("-addnode");
|
||||
connOptions.nMaxOutboundLimit = *opt_max_upload;
|
||||
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.
|
||||
const uint16_t default_bind_port =
|
||||
|
|
16
src/net.h
16
src/net.h
|
@ -1064,6 +1064,8 @@ public:
|
|||
std::vector<std::string> m_specified_outgoing;
|
||||
std::vector<std::string> m_added_nodes;
|
||||
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)
|
||||
|
@ -1098,6 +1100,8 @@ public:
|
|||
}
|
||||
}
|
||||
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,
|
||||
|
@ -1551,6 +1555,18 @@ private:
|
|||
*/
|
||||
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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue