Add RPC command unl_score to request scoring for debugging.

This commit is contained in:
Arthur Britto
2012-04-18 17:24:49 -07:00
parent 99d61cc8e6
commit 65126360c9
2 changed files with 13 additions and 0 deletions

View File

@@ -694,6 +694,17 @@ Json::Value RPCServer::doUnlReset(Json::Value& params) {
else return "invalid params";
}
// unl_score
Json::Value RPCServer::doUnlScore(Json::Value& params) {
if(!params.size())
{
theApp->getUNL().nodeScore();
return "scoring requested";
}
else return "invalid params";
}
Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params)
{
std::cerr << "RPC:" << command << std::endl;
@@ -710,6 +721,7 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params
if(command=="unl_delete") return doUnlDelete(params);
if(command=="unl_list") return doUnlList(params);
if(command=="unl_reset") return doUnlReset(params);
if(command=="unl_score") return doUnlScore(params);
if(command=="validation_create") return doValidatorCreate(params);

View File

@@ -52,6 +52,7 @@ class RPCServer : public boost::enable_shared_from_this<RPCServer>
Json::Value doUnlFetch(Json::Value& params);
Json::Value doUnlList(Json::Value& params);
Json::Value doUnlReset(Json::Value& params);
Json::Value doUnlScore(Json::Value& params);
Json::Value doValidatorCreate(Json::Value& params);