rpc: Use Join helper in rpc/util
This commit is contained in:
parent
fa8cd6f9c1
commit
faebf62714
1 changed files with 3 additions and 6 deletions
|
@ -4,11 +4,12 @@
|
||||||
|
|
||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
#include <outputtype.h>
|
#include <outputtype.h>
|
||||||
#include <script/signingprovider.h>
|
|
||||||
#include <rpc/util.h>
|
#include <rpc/util.h>
|
||||||
#include <script/descriptor.h>
|
#include <script/descriptor.h>
|
||||||
|
#include <script/signingprovider.h>
|
||||||
#include <tinyformat.h>
|
#include <tinyformat.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
|
#include <util/string.h>
|
||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
|
@ -645,11 +646,7 @@ std::string RPCArg::ToString(const bool oneline) const
|
||||||
}
|
}
|
||||||
case Type::OBJ:
|
case Type::OBJ:
|
||||||
case Type::OBJ_USER_KEYS: {
|
case Type::OBJ_USER_KEYS: {
|
||||||
std::string res;
|
const std::string res = Join(m_inner, ",", [&](const RPCArg& i) { return i.ToStringObj(oneline); });
|
||||||
for (size_t i = 0; i < m_inner.size();) {
|
|
||||||
res += m_inner[i].ToStringObj(oneline);
|
|
||||||
if (++i < m_inner.size()) res += ",";
|
|
||||||
}
|
|
||||||
if (m_type == Type::OBJ) {
|
if (m_type == Type::OBJ) {
|
||||||
return "{" + res + "}";
|
return "{" + res + "}";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue