Throw an error if zcash.conf is missing
An empty zcash.conf is sufficient to bypass this error.
This commit is contained in:
@@ -534,7 +534,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
|
|||||||
{
|
{
|
||||||
boost::filesystem::ifstream streamConfig(GetConfigFile());
|
boost::filesystem::ifstream streamConfig(GetConfigFile());
|
||||||
if (!streamConfig.good())
|
if (!streamConfig.good())
|
||||||
return; // No zcash.conf file is OK
|
throw missing_zcash_conf();
|
||||||
|
|
||||||
set<string> setOptions;
|
set<string> setOptions;
|
||||||
setOptions.insert("*");
|
setOptions.insert("*");
|
||||||
|
|||||||
@@ -127,6 +127,10 @@ boost::filesystem::path GetConfigFile();
|
|||||||
boost::filesystem::path GetPidFile();
|
boost::filesystem::path GetPidFile();
|
||||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
||||||
#endif
|
#endif
|
||||||
|
class missing_zcash_conf : public std::runtime_error {
|
||||||
|
public:
|
||||||
|
missing_zcash_conf() : std::runtime_error("Missing zcash.conf") { }
|
||||||
|
};
|
||||||
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
||||||
|
|||||||
Reference in New Issue
Block a user