Skip to content

Commit

Permalink
settxfee stub
Browse files Browse the repository at this point in the history
  • Loading branch information
backpacker69 committed Sep 19, 2019
1 parent bef3479 commit 60ae12e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rpc/client.cpp
Expand Up @@ -37,6 +37,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "sendtoaddress", 4, "subtractfeefromamount" },
{ "sendtoaddress", 5 , "replaceable" },
{ "sendtoaddress", 6 , "conf_target" },
{ "settxfee", 0, "amount" },
{ "getreceivedbyaddress", 1, "minconf" },
{ "getreceivedbyaccount", 1, "minconf" },
{ "listreceivedbyaddress", 0, "minconf" },
Expand Down
25 changes: 25 additions & 0 deletions src/wallet/rpcwallet.cpp
Expand Up @@ -2704,6 +2704,30 @@ UniValue listlockunspent(const JSONRPCRequest& request)
return ret;
}

UniValue settxfee(const JSONRPCRequest& request)
{
CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
return NullUniValue;
}

if (request.fHelp || request.params.size() < 1 || request.params.size() > 1 || AmountFromValue(request.params[0]) < MIN_TX_FEE)
throw std::runtime_error(
"settxfee amount\n"
"\nDeprecated method used to set the transaction fee per kB.\n"
"Minimum and default transaction fee per KB is 1 cent\n"
"\nArguments:\n"
"1. amount (numeric or string, required but ignored) The transaction fee in " + CURRENCY_UNIT + "/kB\n"
"\nResult\n"
"true (boolean) Returns true, does not change anything\n"
"\nExamples:\n"
+ HelpExampleCli("settxfee", "0.01")
+ HelpExampleRpc("settxfee", "0.01")
);

return true;
}

UniValue getwalletinfo(const JSONRPCRequest& request)
{
CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
Expand Down Expand Up @@ -3561,6 +3585,7 @@ static const CRPCCommand commands[] =
{ "wallet", "sendmany", &sendmany, {"fromaccount","amounts","minconf","comment","subtractfeefrom","replaceable","conf_target"} },
{ "wallet", "sendtoaddress", &sendtoaddress, {"address","amount","comment","comment_to","subtractfeefromamount","replaceable","conf_target"} },
{ "wallet", "setaccount", &setaccount, {"address","account"} },
{ "wallet", "settxfee", &settxfee, {"amount"} },
{ "wallet", "signmessage", &signmessage, {"address","message"} },
{ "wallet", "walletlock", &walletlock, {} },
{ "wallet", "walletpassphrasechange", &walletpassphrasechange, {"oldpassphrase","newpassphrase"} },
Expand Down

0 comments on commit 60ae12e

Please sign in to comment.