From 11b6b5b86e7dab05be38d614891dd6e6031d04a4 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 29 Mar 2018 15:00:00 +1000 Subject: Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName --- src/util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 7114c0accd..5afe80cb06 100644 --- a/src/util.h +++ b/src/util.h @@ -306,6 +306,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. -- cgit v1.2.3 From 6d5815aad0ee0614972f288cbd1c68386e801d5d Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 29 Mar 2018 15:02:00 +1000 Subject: Separate out ReadConfigStream from ReadConfigFile --- src/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 5afe80cb06..bfd3184ac2 100644 --- a/src/util.h +++ b/src/util.h @@ -228,6 +228,8 @@ protected: std::map> mapMultiArgs; std::unordered_set m_negated_args; + void ReadConfigStream(std::istream& stream); + public: void ParseParameters(int argc, const char*const argv[]); void ReadConfigFile(const std::string& confPath); -- cgit v1.2.3