Rename UNL methods.

This commit is contained in:
Arthur Britto
2012-04-03 22:48:57 -07:00
parent d72b670afc
commit 8d23d1de40
3 changed files with 17 additions and 13 deletions

View File

@@ -519,7 +519,7 @@ Json::Value RPCServer::doUnlAdd(Json::Value& params) {
if(nodePublic.setNodePublic(strNodePublic)) if(nodePublic.setNodePublic(strNodePublic))
{ {
theApp->getUNL().addNode(nodePublic, strComment); theApp->getUNL().nodeAdd(nodePublic, strComment);
return "adding node"; return "adding node";
} }
@@ -605,7 +605,7 @@ Json::Value RPCServer::doUnlDelete(Json::Value& params) {
if(hanko.setHanko(strHanko)) if(hanko.setHanko(strHanko))
{ {
theApp->getUNL().removeNode(hanko); theApp->getUNL().nodeRemove(hanko);
return "removing node"; return "removing node";
} }
@@ -622,7 +622,7 @@ Json::Value RPCServer::doUnlFetch(Json::Value& params) {
{ {
std::string strDomain=params[0u].asString(); std::string strDomain=params[0u].asString();
theApp->getUNL().fetchNode(strDomain); theApp->getUNL().nodeFetch(strDomain);
return "fetching domain"; return "fetching domain";
} }
@@ -637,7 +637,7 @@ Json::Value RPCServer::doUnlList(Json::Value& params) {
Json::Value RPCServer::doUnlReset(Json::Value& params) { Json::Value RPCServer::doUnlReset(Json::Value& params) {
if(!params.size()) if(!params.size())
{ {
theApp->getUNL().reset(); theApp->getUNL().nodeReset();
return "removing nodes"; return "removing nodes";
} }

View File

@@ -1,7 +1,8 @@
#include "UniqueNodeList.h"
#include "Application.h" #include "Application.h"
#include "Conversion.h" #include "Conversion.h"
#include "HttpsClient.h" #include "HttpsClient.h"
#include "ParseSection.h"
#include "UniqueNodeList.h"
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
@@ -72,7 +73,7 @@ void UniqueNodeList::fetchNext()
} }
// Get newcoin.txt from a domain's web server. // Get newcoin.txt from a domain's web server.
void UniqueNodeList::fetchNode(std::string strDomain) void UniqueNodeList::nodeFetch(std::string strDomain)
{ {
{ {
boost::mutex::scoped_lock sl(mFetchLock); boost::mutex::scoped_lock sl(mFetchLock);
@@ -83,7 +84,7 @@ void UniqueNodeList::fetchNode(std::string strDomain)
fetchNext(); fetchNext();
} }
void UniqueNodeList::addNode(NewcoinAddress naNodePublic, std::string strComment) void UniqueNodeList::nodeAdd(NewcoinAddress naNodePublic, std::string strComment)
{ {
Database* db=theApp->getWalletDB()->getDB(); Database* db=theApp->getWalletDB()->getDB();
@@ -106,7 +107,7 @@ void UniqueNodeList::addNode(NewcoinAddress naNodePublic, std::string strComment
db->executeSQL(strSql.c_str()); db->executeSQL(strSql.c_str());
} }
void UniqueNodeList::removeNode(NewcoinAddress naHanko) void UniqueNodeList::nodeRemove(NewcoinAddress naHanko)
{ {
Database* db=theApp->getWalletDB()->getDB(); Database* db=theApp->getWalletDB()->getDB();
@@ -121,7 +122,7 @@ void UniqueNodeList::removeNode(NewcoinAddress naHanko)
db->executeSQL(strSql.c_str()); db->executeSQL(strSql.c_str());
} }
void UniqueNodeList::reset() void UniqueNodeList::nodeReset()
{ {
Database* db=theApp->getWalletDB()->getDB(); Database* db=theApp->getWalletDB()->getDB();
@@ -200,5 +201,8 @@ void UniqueNodeList::nodeDefault(std::string strValidators) {
std::cerr << strValidators; std::cerr << strValidators;
std::cerr << "Validators<" << std::endl; std::cerr << "Validators<" << std::endl;
section secValidators = ParseSection(strValidators, true);
PrintSection(secValidators);
} }
// vim:ts=4 // vim:ts=4

View File

@@ -35,11 +35,11 @@ private:
public: public:
UniqueNodeList(); UniqueNodeList();
void addNode(NewcoinAddress naNodePublic, std::string strComment); void nodeAdd(NewcoinAddress naNodePublic, std::string strComment);
void fetchNode(std::string strDomain); void nodeFetch(std::string strDomain);
void removeNode(NewcoinAddress naHanko); void nodeRemove(NewcoinAddress naHanko);
void reset();
void nodeDefault(std::string strValidators); void nodeDefault(std::string strValidators);
void nodeReset();
// 2- we don't care, 1- we care and is valid, 2-invalid signature // 2- we don't care, 1- we care and is valid, 2-invalid signature
// int checkValid(newcoin::Validation& valid); // int checkValid(newcoin::Validation& valid);