mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Reduce scope of RPC locks and general cleanup (RIPD-458)
This commit is contained in:
@@ -26,20 +26,26 @@ namespace ripple {
|
||||
// }
|
||||
Json::Value doUnlAdd (RPC::Context& context)
|
||||
{
|
||||
std::string strNode = context.params_.isMember ("node") ? context.params_["node"].asString () : "";
|
||||
std::string strComment = context.params_.isMember ("comment") ? context.params_["comment"].asString () : "";
|
||||
auto lock = getApp().masterLock();
|
||||
|
||||
std::string strNode = context.params_.isMember ("node")
|
||||
? context.params_["node"].asString () : "";
|
||||
std::string strComment = context.params_.isMember ("comment")
|
||||
? context.params_["comment"].asString () : "";
|
||||
|
||||
RippleAddress raNodePublic;
|
||||
|
||||
if (raNodePublic.setNodePublic (strNode))
|
||||
{
|
||||
getApp().getUNL ().nodeAddPublic (raNodePublic, UniqueNodeList::vsManual, strComment);
|
||||
getApp().getUNL ().nodeAddPublic (
|
||||
raNodePublic, UniqueNodeList::vsManual, strComment);
|
||||
|
||||
return "adding node by public key";
|
||||
}
|
||||
else
|
||||
{
|
||||
getApp().getUNL ().nodeAddDomain (strNode, UniqueNodeList::vsManual, strComment);
|
||||
getApp().getUNL ().nodeAddDomain (
|
||||
strNode, UniqueNodeList::vsManual, strComment);
|
||||
|
||||
return "adding node by domain";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user