From 3ac7b0c6f1c68e74a84d868a454f508bada6b09d Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Mon, 19 Oct 2020 11:35:10 +0200 Subject: wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() --- src/rpc/util.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/rpc/util.cpp') diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 40dfdb587e..1b21587b6d 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -272,11 +272,12 @@ UniValue DescribeAddress(const CTxDestination& dest) unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target) { - int target = value.get_int(); - if (target < 1 || (unsigned int)target > max_target) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u - %u", 1, max_target)); + const int target{value.get_int()}; + const unsigned int unsigned_target{static_cast(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)); } - return (unsigned int)target; + return unsigned_target; } RPCErrorCode RPCErrorFromTransactionError(TransactionError terr) -- cgit v1.2.3