mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
rpc: gettxoutsetinfo can specify hash_type (only legacy option for now)
This commit is contained in:
@@ -113,6 +113,21 @@ std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey)
|
||||
return ParseHexV(find_value(o, strKey), strKey);
|
||||
}
|
||||
|
||||
CoinStatsHashType ParseHashType(const UniValue& param, const CoinStatsHashType default_type)
|
||||
{
|
||||
if (param.isNull()) {
|
||||
return default_type;
|
||||
} else {
|
||||
std::string hash_type_input = param.get_str();
|
||||
|
||||
if (hash_type_input == "hash_serialized_2") {
|
||||
return CoinStatsHashType::HASH_SERIALIZED;
|
||||
} else {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%d is not a valid hash_type", hash_type_input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string HelpExampleCli(const std::string& methodname, const std::string& args)
|
||||
{
|
||||
return "> bitcoin-cli " + methodname + " " + args + "\n";
|
||||
|
||||
Reference in New Issue
Block a user