diff options
author | Kiminuo <kiminuo@protonmail.com> | 2022-02-14 14:33:39 +0100 |
---|---|---|
committer | Kiminuo <kiminuo@protonmail.com> | 2022-02-14 14:34:04 +0100 |
commit | d970a85d335202cc85f6604f794c43af6645673f (patch) | |
tree | 699aa1553a5e7ce5af53458d83a3968739eaf6ec /src/rpc/util.cpp | |
parent | 3ce40e64d4ae9419658555fd1fb250b93f52684a (diff) | |
download | bitcoin-d970a85d335202cc85f6604f794c43af6645673f.tar.xz |
Move `GetAllOutputTypes` function from `rpc/rawtransaction.cpp` to `rpc/util.{h|cpp}`
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r-- | src/rpc/util.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 5ef7e26ce8..7c859268be 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -21,6 +21,16 @@ const std::string UNIX_EPOCH_TIME = "UNIX epoch time"; const std::string EXAMPLE_ADDRESS[2] = {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", "bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3"}; +std::string GetAllOutputTypes() +{ + std::vector<std::string> ret; + using U = std::underlying_type<TxoutType>::type; + for (U i = (U)TxoutType::NONSTANDARD; i <= (U)TxoutType::WITNESS_UNKNOWN; ++i) { + ret.emplace_back(GetTxnOutputType(static_cast<TxoutType>(i))); + } + return Join(ret, ", "); +} + void RPCTypeCheck(const UniValue& params, const std::list<UniValueType>& typesExpected, bool fAllowNull) |