mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 20:32:35 -03: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:
parent
fa41c65702
commit
fa58469c77
1 changed files with 2 additions and 1 deletions
|
@ -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, ", ");
|
||||
|
|
Loading…
Reference in a new issue