aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-30 10:11:02 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-21 06:40:18 -0400
commitfa41c657022b8f99c8e6718a0e33c5838c412a0b (patch)
tree04e5a52fbc8bc87062e841559c50ce7a5970925a /src/rpc
parent02b26ba1c119c7732f09f09e3b94f75effa569c0 (diff)
rpc: Simplify GetAllOutputTypes with the Join helper
This commit does not change behavior
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 814f8bddfe..a05ed86954 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -511,12 +511,11 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
static std::string GetAllOutputTypes()
{
- std::string ret;
+ std::vector<std::string> ret;
for (int i = TX_NONSTANDARD; i <= TX_WITNESS_UNKNOWN; ++i) {
- if (i != TX_NONSTANDARD) ret += ", ";
- ret += GetTxnOutputType(static_cast<txnouttype>(i));
+ ret.emplace_back(GetTxnOutputType(static_cast<txnouttype>(i)));
}
- return ret;
+ return Join(ret, ", ");
}
static UniValue decodescript(const JSONRPCRequest& request)