Move settxfee from rpcblockchain to rpcwallet

`settxfee` only affects the wallet, not the block chain.
This commit is contained in:
Wladimir J. van der Laan 2013-12-13 16:06:32 +01:00
parent 16bc9aaf8a
commit a943bde6f0
3 changed files with 26 additions and 25 deletions

View file

@ -127,30 +127,6 @@ Value getdifficulty(const Array& params, bool fHelp)
} }
Value settxfee(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 1)
throw runtime_error(
"settxfee amount\n"
"\nSet the transaction fee. 'amount' is a real and is rounded to the nearest 0.00000001\n"
"\nArguments:\n"
"1. amount (numeric, required) The transaction fee in btc rounded to the nearest 0.00000001\n"
"\nResult\n"
"true|false (boolean) Returns true if successful\n"
"\nExamples:\n"
+ HelpExampleCli("settxfee", "0.00001")
+ HelpExampleRpc("settxfee", "0.00001")
);
// Amount
int64_t nAmount = 0;
if (params[0].get_real() != 0.0)
nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts
nTransactionFee = nAmount;
return true;
}
Value getrawmempool(const Array& params, bool fHelp) Value getrawmempool(const Array& params, bool fHelp)
{ {
if (fHelp || params.size() > 1) if (fHelp || params.size() > 1)

View file

@ -237,7 +237,6 @@ static const CRPCCommand vRPCCommands[] =
{ "getrawmempool", &getrawmempool, true, false, false }, { "getrawmempool", &getrawmempool, true, false, false },
{ "getblock", &getblock, false, false, false }, { "getblock", &getblock, false, false, false },
{ "getblockhash", &getblockhash, false, false, false }, { "getblockhash", &getblockhash, false, false, false },
{ "settxfee", &settxfee, false, false, true },
{ "getrawtransaction", &getrawtransaction, false, false, false }, { "getrawtransaction", &getrawtransaction, false, false, false },
{ "createrawtransaction", &createrawtransaction, false, false, false }, { "createrawtransaction", &createrawtransaction, false, false, false },
{ "decoderawtransaction", &decoderawtransaction, false, false, false }, { "decoderawtransaction", &decoderawtransaction, false, false, false },
@ -294,6 +293,7 @@ static const CRPCCommand vRPCCommands[] =
{ "listunspent", &listunspent, false, false, true }, { "listunspent", &listunspent, false, false, true },
{ "lockunspent", &lockunspent, false, false, true }, { "lockunspent", &lockunspent, false, false, true },
{ "listlockunspent", &listlockunspent, false, false, true }, { "listlockunspent", &listlockunspent, false, false, true },
{ "settxfee", &settxfee, false, false, true },
/* Wallet-enabled mining */ /* Wallet-enabled mining */
{ "getgenerate", &getgenerate, true, false, false }, { "getgenerate", &getgenerate, true, false, false },

View file

@ -2066,3 +2066,28 @@ Value listlockunspent(const Array& params, bool fHelp)
return ret; return ret;
} }
Value settxfee(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 1)
throw runtime_error(
"settxfee amount\n"
"\nSet the transaction fee. 'amount' is a real and is rounded to the nearest 0.00000001\n"
"\nArguments:\n"
"1. amount (numeric, required) The transaction fee in btc rounded to the nearest 0.00000001\n"
"\nResult\n"
"true|false (boolean) Returns true if successful\n"
"\nExamples:\n"
+ HelpExampleCli("settxfee", "0.00001")
+ HelpExampleRpc("settxfee", "0.00001")
);
// Amount
int64_t nAmount = 0;
if (params[0].get_real() != 0.0)
nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts
nTransactionFee = nAmount;
return true;
}