Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.h
Show All 15 Lines | |||||
#include <attributes.h> | #include <attributes.h> | ||||
#include <compat.h> | #include <compat.h> | ||||
#include <compat/assumptions.h> | #include <compat/assumptions.h> | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <logging.h> | #include <logging.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
#include <util/settings.h> | |||||
#include <util/threadnames.h> | #include <util/threadnames.h> | ||||
#include <util/time.h> | #include <util/time.h> | ||||
#include <boost/thread/condition_variable.hpp> // for boost::thread_interrupted | #include <boost/thread/condition_variable.hpp> // for boost::thread_interrupted | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <exception> | #include <exception> | ||||
#include <map> | #include <map> | ||||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | protected: | ||||
struct Arg { | struct Arg { | ||||
std::string m_help_param; | std::string m_help_param; | ||||
std::string m_help_text; | std::string m_help_text; | ||||
unsigned int m_flags; | unsigned int m_flags; | ||||
}; | }; | ||||
mutable RecursiveMutex cs_args; | mutable RecursiveMutex cs_args; | ||||
std::map<std::string, std::vector<std::string>> | util::Settings m_settings GUARDED_BY(cs_args); | ||||
m_override_args GUARDED_BY(cs_args); | |||||
std::map<std::string, std::vector<std::string>> | |||||
m_config_args GUARDED_BY(cs_args); | |||||
std::string m_network GUARDED_BY(cs_args); | std::string m_network GUARDED_BY(cs_args); | ||||
std::set<std::string> m_network_only_args GUARDED_BY(cs_args); | std::set<std::string> m_network_only_args GUARDED_BY(cs_args); | ||||
std::map<OptionsCategory, std::map<std::string, Arg>> | std::map<OptionsCategory, std::map<std::string, Arg>> | ||||
m_available_args GUARDED_BY(cs_args); | m_available_args GUARDED_BY(cs_args); | ||||
std::list<SectionInfo> m_config_sections GUARDED_BY(cs_args); | std::list<SectionInfo> m_config_sections GUARDED_BY(cs_args); | ||||
NODISCARD bool ReadConfigStream(std::istream &stream, | NODISCARD bool ReadConfigStream(std::istream &stream, | ||||
const std::string &filepath, | const std::string &filepath, | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | public: | ||||
bool SoftSetBoolArg(const std::string &strArg, bool fValue); | bool SoftSetBoolArg(const std::string &strArg, bool fValue); | ||||
// Forces an arg setting. Called by SoftSetArg() if the arg hasn't already | // Forces an arg setting. Called by SoftSetArg() if the arg hasn't already | ||||
// been set. Also called directly in testing. | // been set. Also called directly in testing. | ||||
void ForceSetArg(const std::string &strArg, const std::string &strValue); | void ForceSetArg(const std::string &strArg, const std::string &strValue); | ||||
// Forces a multi arg setting, used only in testing | // Forces a multi arg setting, used only in testing | ||||
void ForceSetMultiArg(const std::string &strArg, | void ForceSetMultiArg(const std::string &strArg, | ||||
const std::string &strValue); | const std::vector<std::string> &values); | ||||
/** | /** | ||||
* Looks for -regtest, -testnet and returns the appropriate BIP70 chain | * Looks for -regtest, -testnet and returns the appropriate BIP70 chain | ||||
* name. | * name. | ||||
* @return CBaseChainParams::MAIN by default; raises runtime error if an | * @return CBaseChainParams::MAIN by default; raises runtime error if an | ||||
* invalid combination is given. | * invalid combination is given. | ||||
*/ | */ | ||||
std::string GetChainName() const; | std::string GetChainName() const; | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |