aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2016-06-06 17:50:50 +0200
committerMarcoFalke <falke.marco@gmail.com>2016-06-07 13:12:57 +0200
commitfa7f4f577cbab2b4bc03b5427704c2ec16680c34 (patch)
tree9ceac88ffe807278f80ca8d3afb3aa4a6de14207 /src/wallet/rpcwallet.cpp
parentfaf82e8fc819b2f1f8b60983ac72cb111c47e8ba (diff)
downloadbitcoin-fa7f4f577cbab2b4bc03b5427704c2ec16680c34.tar.xz
[rpc] fundrawtransaction feeRate: Use BTC/kB
Also introduce UniValueType UniValueType is a wrapper for UniValue::VType which allows setting a typeAny flag. This flag indicates the type does not matter. (Used by RPCTypeCheckObj)
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 68895ac526..1300e39aa9 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2069,7 +2069,11 @@ UniValue lockunspent(const UniValue& params, bool fHelp)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected object");
const UniValue& o = output.get_obj();
- RPCTypeCheckObj(o, boost::assign::map_list_of("txid", UniValue::VSTR)("vout", UniValue::VNUM));
+ RPCTypeCheckObj(o,
+ {
+ {"txid", UniValueType(UniValue::VSTR)},
+ {"vout", UniValueType(UniValue::VNUM)},
+ });
string txid = find_value(o, "txid").get_str();
if (!IsHex(txid))
@@ -2369,7 +2373,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
" \"changePosition\" (numeric, optional, default random) The index of the change output\n"
" \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n"
" \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n"
- " \"feeRate\" (numeric, optional, default not set: makes wallet determine the fee) Set a specific feerate (satoshis per KB)\n"
+ " \"feeRate\" (numeric, optional, default not set: makes wallet determine the fee) Set a specific feerate (" + CURRENCY_UNIT + " per KB)\n"
" }\n"
" for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n"
"\nResult:\n"
@@ -2409,7 +2413,15 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
UniValue options = params[1];
- RPCTypeCheckObj(options, boost::assign::map_list_of("changeAddress", UniValue::VSTR)("changePosition", UniValue::VNUM)("includeWatching", UniValue::VBOOL)("lockUnspents", UniValue::VBOOL)("feeRate", UniValue::VNUM), true, true);
+ RPCTypeCheckObj(options,
+ {
+ {"changeAddress", UniValueType(UniValue::VSTR)},
+ {"changePosition", UniValueType(UniValue::VNUM)},
+ {"includeWatching", UniValueType(UniValue::VBOOL)},
+ {"lockUnspents", UniValueType(UniValue::VBOOL)},
+ {"feeRate", UniValueType()}, // will be checked below
+ },
+ true, true);
if (options.exists("changeAddress")) {
CBitcoinAddress address(options["changeAddress"].get_str());
@@ -2431,7 +2443,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
if (options.exists("feeRate"))
{
- feeRate = CFeeRate(options["feeRate"].get_real());
+ feeRate = CFeeRate(AmountFromValue(options["feeRate"]));
overrideEstimatedFeerate = true;
}
}