Improve reporting for bad validators.txt.

This commit is contained in:
Arthur Britto
2012-04-30 13:59:02 -07:00
parent 0ab34eee3d
commit fc2ce4ea35
4 changed files with 15 additions and 6 deletions

View File

@@ -4,7 +4,9 @@
#include <string> #include <string>
#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; const int SYSTEM_PEER_PORT=6561;
// Allow anonymous DH. // Allow anonymous DH.

View File

@@ -22,10 +22,8 @@
#include "AccountState.h" #include "AccountState.h"
#define VALIDATORS_FETCH_SECONDS 30 #define VALIDATORS_FETCH_SECONDS 30
#define VALIDATORS_FILE_NAME "validators.txt"
#define VALIDATORS_FILE_PATH "/" VALIDATORS_FILE_NAME #define VALIDATORS_FILE_PATH "/" VALIDATORS_FILE_NAME
#define VALIDATORS_FILE_BYTES_MAX (50 << 10) #define VALIDATORS_FILE_BYTES_MAX (50 << 10)
#define VALIDATORS_SITE "redstem.com"
/* /*
Just read from wire until the entire request is in. Just read from wire until the entire request is in.

View File

@@ -1020,9 +1020,14 @@ int UniqueNodeList::iSourceScore(validatorSource vsWhy)
// Queue a domain for a single attempt fetch a newcoin.txt. // Queue a domain for a single attempt fetch a newcoin.txt.
// --> strComment: only used on vsManual // --> 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. // 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. // 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; seedDomain sdCurrent;
bool bFound = getSeedDomains(strDomain, sdCurrent); bool bFound = getSeedDomains(strDomain, sdCurrent);
@@ -1211,6 +1216,10 @@ void UniqueNodeList::nodeDefault(std::string strValidators) {
nodeAddDomain(strValidator, vsValidator); nodeAddDomain(strValidator, vsValidator);
} }
} }
else
{
std::cerr << "WARNING: '" VALIDATORS_FILE_NAME "' missing [" SECTION_VALIDATORS "]." << std::endl;
}
} }
// vim:ts=4 // vim:ts=4

View File

@@ -116,7 +116,7 @@ public:
void start(); void start();
void nodeAddPublic(NewcoinAddress naNodePublic, std::string strComment); 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 nodeRemove(NewcoinAddress naNodePublic);
void nodeDefault(std::string strValidators); void nodeDefault(std::string strValidators);
void nodeReset(); void nodeReset();