Rename unl_default to validators_file.

This commit is contained in:
Arthur Britto
2012-11-20 13:13:52 -08:00
parent ddf380c6e5
commit 3cb3b41cef
5 changed files with 154 additions and 8 deletions

View File

@@ -27,7 +27,7 @@
#define SECTION_RPC_IP "rpc_ip"
#define SECTION_RPC_PORT "rpc_port"
#define SECTION_SNTP "sntp_servers"
#define SECTION_UNL_DEFAULT "unl_default"
#define SECTION_VALIDATORS_FILE "validators_file"
#define SECTION_VALIDATION_QUORUM "validation_quorum"
#define SECTION_VALIDATION_SEED "validation_seed"
#define SECTION_WEBSOCKET_PUBLIC_IP "websocket_public_ip"
@@ -292,8 +292,8 @@ void Config::load()
if (sectionSingleB(secConfig, SECTION_ACCOUNT_PROBE_MAX, strTemp))
ACCOUNT_PROBE_MAX = boost::lexical_cast<int>(strTemp);
if (sectionSingleB(secConfig, SECTION_UNL_DEFAULT, strTemp))
UNL_DEFAULT = strTemp;
if (sectionSingleB(secConfig, SECTION_VALIDATORS_FILE, strTemp))
VALIDATORS_FILE = strTemp;
if (sectionSingleB(secConfig, SECTION_DEBUG_LOGFILE, strTemp))
DEBUG_LOGFILE = strTemp;

View File

@@ -50,7 +50,7 @@ public:
boost::filesystem::path CONFIG_DIR;
boost::filesystem::path DATA_DIR;
boost::filesystem::path DEBUG_LOGFILE;
boost::filesystem::path UNL_DEFAULT;
boost::filesystem::path VALIDATORS_FILE;
std::string VALIDATORS_SITE; // Where to find validators.txt on the Internet.
std::vector<std::string> VALIDATORS; // Validators from rippled.cfg.

View File

@@ -1638,7 +1638,7 @@ Json::Value RPCHandler::doUnlList(const Json::Value& params)
// Populate the UNL from a local validators.txt file.
Json::Value RPCHandler::doUnlLoad(const Json::Value& params)
{
if (theConfig.UNL_DEFAULT.empty() || !theApp->getUNL().nodeLoad(theConfig.UNL_DEFAULT))
if (theConfig.VALIDATORS_FILE.empty() || !theApp->getUNL().nodeLoad(theConfig.VALIDATORS_FILE))
{
return rpcError(rpcLOAD_FAILED);
}

View File

@@ -1576,15 +1576,15 @@ void UniqueNodeList::nodeBootstrap()
bool bLoaded = iDomains || iNodes;
// Always merge in the file specified in the config.
if (!theConfig.UNL_DEFAULT.empty())
if (!theConfig.VALIDATORS_FILE.empty())
{
cLog(lsINFO) << "Bootstrapping UNL: loading from unl_default.";
bLoaded = nodeLoad(theConfig.UNL_DEFAULT);
bLoaded = nodeLoad(theConfig.VALIDATORS_FILE);
}
// If never loaded anything try the current directory.
if (!bLoaded && theConfig.UNL_DEFAULT.empty())
if (!bLoaded && theConfig.VALIDATORS_FILE.empty())
{
cLog(lsINFO) << "Bootstrapping UNL: loading from '" VALIDATORS_FILE_NAME "'.";