mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add unl_delete command.
This commit is contained in:
@@ -497,21 +497,21 @@ Json::Value RPCServer::doLedger(Json::Value& params)
|
|||||||
return "not implemented";
|
return "not implemented";
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value RPCServer::doUnlAdd(Json::Value& params) {
|
|
||||||
// unl_add <node_public>
|
// unl_add <node_public>
|
||||||
// unl_add <node_public> <comment>
|
// unl_add <node_public> <comment>
|
||||||
|
Json::Value RPCServer::doUnlAdd(Json::Value& params) {
|
||||||
if(params.size()==1 || params.size()==2)
|
if(params.size()==1 || params.size()==2)
|
||||||
{
|
{
|
||||||
std::string pubKey=params[0u].asString();
|
std::string strNodePublic=params[0u].asString();
|
||||||
std::string comment=params.size() == 2
|
std::string strComment=params.size() == 2
|
||||||
? ""
|
? ""
|
||||||
: params[1u].asString();
|
: params[1u].asString();
|
||||||
|
|
||||||
NewcoinAddress nodePublic;
|
NewcoinAddress nodePublic;
|
||||||
|
|
||||||
if(nodePublic.setNodePublic(pubKey))
|
if(nodePublic.setNodePublic(strNodePublic))
|
||||||
{
|
{
|
||||||
theApp->getUNL().addNode(nodePublic, comment);
|
theApp->getUNL().addNode(nodePublic, strComment);
|
||||||
|
|
||||||
return "adding node";
|
return "adding node";
|
||||||
}
|
}
|
||||||
@@ -527,8 +527,26 @@ Json::Value RPCServer::doUnlDefault(Json::Value& params) {
|
|||||||
return "not implemented";
|
return "not implemented";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unl_delete <hanko>
|
||||||
Json::Value RPCServer::doUnlDelete(Json::Value& params) {
|
Json::Value RPCServer::doUnlDelete(Json::Value& params) {
|
||||||
return "not implemented";
|
if(params.size()==1)
|
||||||
|
{
|
||||||
|
std::string strHanko=params[0u].asString();
|
||||||
|
|
||||||
|
NewcoinAddress hanko;
|
||||||
|
|
||||||
|
if(hanko.setHanko(strHanko))
|
||||||
|
{
|
||||||
|
theApp->getUNL().removeNode(hanko);
|
||||||
|
|
||||||
|
return "removing node";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "invalid hanko";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else return "invalid params";
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value RPCServer::doUnlFetch(Json::Value& params) {
|
Json::Value RPCServer::doUnlFetch(Json::Value& params) {
|
||||||
|
|||||||
Reference in New Issue
Block a user