mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Fix getaddednodeinfo
RPC call with dns=false
The getaddednodeinfo RPC call, when invoked with the dns flag set to false, returns a malformed JSON object with duplicate keys. Change this to return an array of objects with one key as shown in the help message. Fixes #3581.
This commit is contained in:
parent
e16ee005ec
commit
4412c5a759
@ -255,16 +255,18 @@ Value getaddednodeinfo(const Array& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node has not been added.");
|
throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node has not been added.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Array ret;
|
||||||
if (!fDns)
|
if (!fDns)
|
||||||
{
|
{
|
||||||
Object ret;
|
|
||||||
BOOST_FOREACH(string& strAddNode, laddedNodes)
|
BOOST_FOREACH(string& strAddNode, laddedNodes)
|
||||||
ret.push_back(Pair("addednode", strAddNode));
|
{
|
||||||
|
Object obj;
|
||||||
|
obj.push_back(Pair("addednode", strAddNode));
|
||||||
|
ret.push_back(obj);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Array ret;
|
|
||||||
|
|
||||||
list<pair<string, vector<CService> > > laddedAddreses(0);
|
list<pair<string, vector<CService> > > laddedAddreses(0);
|
||||||
BOOST_FOREACH(string& strAddNode, laddedNodes)
|
BOOST_FOREACH(string& strAddNode, laddedNodes)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user