Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | public: | ||||
// Stop RPC for clean shutdown if any of waitfor* commands is | // Stop RPC for clean shutdown if any of waitfor* commands is | ||||
// executed. | // executed. | ||||
if (gArgs.GetBoolArg("-server", false)) { | if (gArgs.GetBoolArg("-server", false)) { | ||||
InterruptRPC(); | InterruptRPC(); | ||||
StopRPC(); | StopRPC(); | ||||
} | } | ||||
} | } | ||||
bool shutdownRequested() override { return ShutdownRequested(); } | bool shutdownRequested() override { return ShutdownRequested(); } | ||||
bool isSettingIgnored(const std::string &name) override { | |||||
bool ignored = false; | |||||
gArgs.LockSettings([&](util::Settings &settings) { | |||||
if (auto *options = | |||||
util::FindKey(settings.command_line_options, name)) { | |||||
ignored = !options->empty(); | |||||
} | |||||
}); | |||||
return ignored; | |||||
} | |||||
util::SettingsValue | |||||
getPersistentSetting(const std::string &name) override { | |||||
return gArgs.GetPersistentSetting(name); | |||||
} | |||||
void updateRwSetting(const std::string &name, | |||||
const util::SettingsValue &value) override { | |||||
gArgs.LockSettings([&](util::Settings &settings) { | |||||
if (value.isNull()) { | |||||
settings.rw_settings.erase(name); | |||||
} else { | |||||
settings.rw_settings[name] = value; | |||||
} | |||||
}); | |||||
gArgs.WriteSettingsFile(); | |||||
} | |||||
void forceSetting(const std::string &name, | |||||
const util::SettingsValue &value) override { | |||||
gArgs.LockSettings([&](util::Settings &settings) { | |||||
if (value.isNull()) { | |||||
settings.forced_settings.erase(name); | |||||
} else { | |||||
settings.forced_settings[name] = value; | |||||
} | |||||
}); | |||||
} | |||||
void mapPort(bool use_upnp, bool use_natpmp) override { | void mapPort(bool use_upnp, bool use_natpmp) override { | ||||
StartMapPort(use_upnp, use_natpmp); | StartMapPort(use_upnp, use_natpmp); | ||||
} | } | ||||
bool getProxy(Network net, proxyType &proxy_info) override { | bool getProxy(Network net, proxyType &proxy_info) override { | ||||
return GetProxy(net, proxy_info); | return GetProxy(net, proxy_info); | ||||
} | } | ||||
size_t getNodeCount(CConnman::NumConnections flags) override { | size_t getNodeCount(CConnman::NumConnections flags) override { | ||||
return m_context->connman ? m_context->connman->GetNodeCount(flags) | return m_context->connman ? m_context->connman->GetNodeCount(flags) | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |