diff --git a/src/Config.h b/src/Config.h index 1fe5ca57a..40e4da145 100644 --- a/src/Config.h +++ b/src/Config.h @@ -3,8 +3,10 @@ #include -#define SYSTEM_NAME "newcoin" +#define SYSTEM_NAME "newcoin" +#define VALIDATORS_SITE "redstem.com" +#define VALIDATORS_FILE_NAME "validators.txt" const int SYSTEM_PEER_PORT=6561; // Allow anonymous DH. diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index f72e25671..e444a23c3 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -22,10 +22,8 @@ #include "AccountState.h" #define VALIDATORS_FETCH_SECONDS 30 -#define VALIDATORS_FILE_NAME "validators.txt" #define VALIDATORS_FILE_PATH "/" VALIDATORS_FILE_NAME #define VALIDATORS_FILE_BYTES_MAX (50 << 10) -#define VALIDATORS_SITE "redstem.com" /* Just read from wire until the entire request is in. @@ -609,7 +607,7 @@ void RPCServer::validatorsResponse(const boost::system::error_code& err, std::st { std::cerr << "Fetch '" VALIDATORS_FILE_NAME "' complete." << std::endl; - if(!err) + if (!err) { theApp->getUNL().nodeDefault(strResponse); } diff --git a/src/UniqueNodeList.cpp b/src/UniqueNodeList.cpp index a6e1a2274..1d49924b7 100644 --- a/src/UniqueNodeList.cpp +++ b/src/UniqueNodeList.cpp @@ -1020,9 +1020,14 @@ int UniqueNodeList::iSourceScore(validatorSource vsWhy) // Queue a domain for a single attempt fetch a newcoin.txt. // --> strComment: only used on vsManual // YYY As a lot of these may happen at once, would be nice to wrap multiple calls in a transaction. -void UniqueNodeList::nodeAddDomain(std::string strDomain, validatorSource vsWhy, std::string strComment) +void UniqueNodeList::nodeAddDomain(const std::string& strDomain, validatorSource vsWhy, std::string strComment) { // YYY Would be best to verify strDomain is a valid domain. + // std::cerr << str(boost::format("nodeAddDomain: '%s' %c '%s'") + // % strDomain + // % vsWhy + // % strComment) << std::endl; + seedDomain sdCurrent; bool bFound = getSeedDomains(strDomain, sdCurrent); @@ -1211,6 +1216,10 @@ void UniqueNodeList::nodeDefault(std::string strValidators) { nodeAddDomain(strValidator, vsValidator); } } + else + { + std::cerr << "WARNING: '" VALIDATORS_FILE_NAME "' missing [" SECTION_VALIDATORS "]." << std::endl; + } } // vim:ts=4 diff --git a/src/UniqueNodeList.h b/src/UniqueNodeList.h index 83ea26ebc..c979871de 100644 --- a/src/UniqueNodeList.h +++ b/src/UniqueNodeList.h @@ -116,7 +116,7 @@ public: void start(); void nodeAddPublic(NewcoinAddress naNodePublic, std::string strComment); - void nodeAddDomain(std::string strDomain, validatorSource vsWhy, std::string strComment=""); + void nodeAddDomain(const std::string& strDomain, validatorSource vsWhy, std::string strComment=""); void nodeRemove(NewcoinAddress naNodePublic); void nodeDefault(std::string strValidators); void nodeReset();