aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 17881ff3b6..3952461e48 100644
--- a/src/util.h
+++ b/src/util.h
@@ -23,6 +23,7 @@
#include <atomic>
#include <exception>
#include <map>
+#include <memory>
#include <stdint.h>
#include <string>
#include <unordered_set>
@@ -227,6 +228,8 @@ protected:
std::map<std::string, std::vector<std::string>> mapMultiArgs;
std::unordered_set<std::string> m_negated_args;
+ void ReadConfigStream(std::istream& stream);
+
public:
void ParseParameters(int argc, const char*const argv[]);
void ReadConfigFile(const std::string& confPath);
@@ -305,6 +308,12 @@ public:
// been set. Also called directly in testing.
void ForceSetArg(const std::string& strArg, const std::string& strValue);
+ /**
+ * Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
+ * @return CBaseChainParams::MAIN by default; raises runtime error if an invalid combination is given.
+ */
+ std::string GetChainName() const;
+
private:
// Munge -nofoo into -foo=0 and track the value as negated.
@@ -380,4 +389,13 @@ std::unique_ptr<T> MakeUnique(Args&&... args)
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
+/**
+ * On platforms that support it, tell the kernel the calling thread is
+ * CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
+ *
+ * @return The return value of sched_setschedule(), or 1 on systems without
+ * sched_setchedule().
+ */
+int ScheduleBatchPriority(void);
+
#endif // BITCOIN_UTIL_H