mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-28 16:43:16 +02:00
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.
This commit is contained in:
@@ -512,7 +512,8 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
|
|||||||
static std::string GetAllOutputTypes()
|
static std::string GetAllOutputTypes()
|
||||||
{
|
{
|
||||||
std::vector<std::string> ret;
|
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)));
|
ret.emplace_back(GetTxnOutputType(static_cast<txnouttype>(i)));
|
||||||
}
|
}
|
||||||
return Join(ret, ", ");
|
return Join(ret, ", ");
|
||||||
|
Reference in New Issue
Block a user