Browse Source

Fixed list namespaces output - used valid JSON.

cn
Jianping Wu 6 years ago
parent
commit
080740146f
  1. 8
      src/wallet/rpckeva.cpp

8
src/wallet/rpckeva.cpp

@ -178,7 +178,9 @@ UniValue keva_list_namespaces(const JSONRPCRequest& request)
UniValue res(UniValue::VARR); UniValue res(UniValue::VARR);
for (const auto& item : mapObjects) { for (const auto& item : mapObjects) {
res.push_back(item.first + " : " + item.second); UniValue obj(UniValue::VOBJ);
obj.pushKV(item.first, item.second);
res.push_back(obj);
} }
{ {
@ -187,7 +189,9 @@ UniValue keva_list_namespaces(const JSONRPCRequest& request)
std::vector<std::tuple<valtype, valtype, uint256>> unconfirmedNamespaces; std::vector<std::tuple<valtype, valtype, uint256>> unconfirmedNamespaces;
mempool.getUnconfirmedNamespaceList(unconfirmedNamespaces); mempool.getUnconfirmedNamespaceList(unconfirmedNamespaces);
for (auto entry : unconfirmedNamespaces) { for (auto entry : unconfirmedNamespaces) {
res.push_back(EncodeBase58Check(std::get<0>(entry)) + " : " + ValtypeToString(std::get<1>(entry))); UniValue obj(UniValue::VOBJ);
obj.pushKV(EncodeBase58Check(std::get<0>(entry)), ValtypeToString(std::get<1>(entry)));
res.push_back(obj);
} }
} }

Loading…
Cancel
Save