diff options
| author | MarcoFalke <[email protected]> | 2020-05-30 10:11:02 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-06-21 06:40:18 -0400 |
| commit | fa41c657022b8f99c8e6718a0e33c5838c412a0b (patch) | |
| tree | 04e5a52fbc8bc87062e841559c50ce7a5970925a /src | |
| parent | Merge #19200: rpc: remove deprecated getaddressinfo fields (diff) | |
| download | discoin-fa41c657022b8f99c8e6718a0e33c5838c412a0b.tar.xz discoin-fa41c657022b8f99c8e6718a0e33c5838c412a0b.zip | |
rpc: Simplify GetAllOutputTypes with the Join helper
This commit does not change behavior
Diffstat (limited to 'src')
| -rw-r--r-- | src/rpc/rawtransaction.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 814f8bddf..a05ed8695 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) |