aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-13 12:32:59 +0200
committerMacroFake <falke.marco@gmail.com>2022-05-18 19:15:03 +0200
commitfa9af218780b7960d756db80c57222e5bf2137b1 (patch)
treed2388623573ec1a756aac320555ffa106d42743e /src/rpc/util.cpp
parente016c00e98b8e460c965cab050cb08a4f1a1d6f1 (diff)
downloadbitcoin-fa9af218780b7960d756db80c57222e5bf2137b1.tar.xz
scripted-diff: Use getInt<T> over get_int/get_int64
-BEGIN VERIFY SCRIPT- sed -i 's|\<get_int64\>|getInt<int64_t>|g' $(git grep -l get_int ':(exclude)src/univalue') sed -i 's|\<get_int\>|getInt<int>|g' $(git grep -l get_int ':(exclude)src/univalue') -END VERIFY SCRIPT-
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index ef3e58494e..23f0c936c6 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -337,7 +337,7 @@ UniValue DescribeAddress(const CTxDestination& dest)
unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target)
{
- const int target{value.get_int()};
+ const int target{value.getInt<int>()};
const unsigned int unsigned_target{static_cast<unsigned int>(target)};
if (target < 1 || unsigned_target > max_target) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u and %u", 1, max_target));
@@ -1023,11 +1023,11 @@ std::string RPCArg::ToString(const bool oneline) const
static std::pair<int64_t, int64_t> ParseRange(const UniValue& value)
{
if (value.isNum()) {
- return {0, value.get_int64()};
+ return {0, value.getInt<int64_t>()};
}
if (value.isArray() && value.size() == 2 && value[0].isNum() && value[1].isNum()) {
- int64_t low = value[0].get_int64();
- int64_t high = value[1].get_int64();
+ int64_t low = value[0].getInt<int64_t>();
+ int64_t high = value[1].getInt<int64_t>();
if (low > high) throw JSONRPCError(RPC_INVALID_PARAMETER, "Range specified as [begin,end] must not have begin after end");
return {low, high};
}