ArgsManager: limit some options to only apply on mainnet when in default section

When specified in bitcoin.conf without using the [regtest] or [test]
section header, or a "regtest." or "test." prefix, the "addnode",
"connect", "port", "bind", "rpcport", "rpcbind", and "wallet" settings
will only be applied when running on mainnet.
This commit is contained in:
Anthony Towns
2018-04-04 18:06:00 +10:00
parent 8a9817d175
commit d1fc4d95af
2 changed files with 39 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
#include <exception>
#include <map>
#include <memory>
#include <set>
#include <stdint.h>
#include <string>
#include <unordered_set>
@@ -229,9 +230,13 @@ protected:
std::map<std::string, std::vector<std::string>> m_override_args;
std::map<std::string, std::vector<std::string>> m_config_args;
std::string m_network;
std::set<std::string> m_network_only_args;
void ReadConfigStream(std::istream& stream);
public:
ArgsManager();
/**
* Select the network in use
*/