aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-10-19 11:35:10 +0200
committerJon Atack <jon@atack.com>2020-10-29 00:21:57 +0100
commit3ac7b0c6f1c68e74a84d868a454f508bada6b09d (patch)
treea9c660cddd1819a6044c9c5c60befc196e81b092 /src
parent2d8eba8f8425a2515022d51f1f5b4911329fbf55 (diff)
wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget()
Diffstat (limited to 'src')
-rw-r--r--src/rpc/util.cpp9
1 files changed, 5 insertions, 4 deletions
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<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));
}
- return (unsigned int)target;
+ return unsigned_target;
}
RPCErrorCode RPCErrorFromTransactionError(TransactionError terr)