scripted-diff: Modernize nLocalServices to m_local_services

-BEGIN VERIFY SCRIPT-
sed -i 's/nLocalServices/m_local_services/g' src/net.h src/net.cpp
sed -i 's/connOptions.nLocalServices/connOptions.m_local_services/g' src/init.cpp
sed -i 's/nLocalServices/g_local_services/g' src/init.cpp
-END VERIFY SCRIPT-
This commit is contained in:
Fabian Jahr
2024-09-12 15:55:12 +02:00
parent a5e99669cc
commit 33381ea530
3 changed files with 13 additions and 13 deletions

View File

@@ -1035,7 +1035,7 @@ public:
struct Options
{
ServiceFlags nLocalServices = NODE_NONE;
ServiceFlags m_local_services = NODE_NONE;
int m_max_automatic_connections = 0;
CClientUIInterface* uiInterface = nullptr;
NetEventsInterface* m_msgproc = nullptr;
@@ -1065,7 +1065,7 @@ public:
{
AssertLockNotHeld(m_total_bytes_sent_mutex);
nLocalServices = connOptions.nLocalServices;
m_local_services = connOptions.m_local_services;
m_max_automatic_connections = connOptions.m_max_automatic_connections;
m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, m_max_automatic_connections);
m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, m_max_automatic_connections - m_max_outbound_full_relay);
@@ -1223,8 +1223,8 @@ public:
//! Updates the local services that this node advertises to other peers
//! during connection handshake.
void AddLocalServices(ServiceFlags services) { nLocalServices = ServiceFlags(nLocalServices | services); };
void RemoveLocalServices(ServiceFlags services) { nLocalServices = ServiceFlags(nLocalServices & ~services); }
void AddLocalServices(ServiceFlags services) { m_local_services = ServiceFlags(m_local_services | services); };
void RemoveLocalServices(ServiceFlags services) { m_local_services = ServiceFlags(m_local_services & ~services); }
uint64_t GetMaxOutboundTarget() const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
std::chrono::seconds GetMaxOutboundTimeframe() const;
@@ -1470,7 +1470,7 @@ private:
*
* \sa Peer::our_services
*/
std::atomic<ServiceFlags> nLocalServices;
std::atomic<ServiceFlags> m_local_services;
std::unique_ptr<CSemaphore> semOutbound;
std::unique_ptr<CSemaphore> semAddnode;