aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-30 10:13:48 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-21 06:40:26 -0400
commitfa58469c770d8c935a86462634e4e8cd806aa6e3 (patch)
tree148684d56f7a95a997f2afcf03730a657bc86435 /src/rpc/rawtransaction.cpp
parentfa41c657022b8f99c8e6718a0e33c5838c412a0b (diff)
rpc: Properly use underlying type in GetAllOutputTypes
Don't blindly assume it is int. In practice this is usually `unsigned` or `int`, so this commit should not change behavior.
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r--src/rpc/rawtransaction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index a05ed86954..6e6fe0a7bf 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -512,7 +512,8 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
static std::string GetAllOutputTypes()
{
std::vector<std::string> ret;
- for (int i = TX_NONSTANDARD; i <= TX_WITNESS_UNKNOWN; ++i) {
+ using U = std::underlying_type<txnouttype>::type;
+ for (U i = (U)TX_NONSTANDARD; i <= (U)TX_WITNESS_UNKNOWN; ++i) {
ret.emplace_back(GetTxnOutputType(static_cast<txnouttype>(i)));
}
return Join(ret, ", ");