Skip to content

Commit a943bde

Browse files
committed
Move settxfee from rpcblockchain to rpcwallet
`settxfee` only affects the wallet, not the block chain.
1 parent 16bc9aa commit a943bde

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

src/rpcblockchain.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,30 +127,6 @@ Value getdifficulty(const Array& params, bool fHelp)
127127
}
128128

129129

130-
Value settxfee(const Array& params, bool fHelp)
131-
{
132-
if (fHelp || params.size() < 1 || params.size() > 1)
133-
throw runtime_error(
134-
"settxfee amount\n"
135-
"\nSet the transaction fee. 'amount' is a real and is rounded to the nearest 0.00000001\n"
136-
"\nArguments:\n"
137-
"1. amount (numeric, required) The transaction fee in btc rounded to the nearest 0.00000001\n"
138-
"\nResult\n"
139-
"true|false (boolean) Returns true if successful\n"
140-
"\nExamples:\n"
141-
+ HelpExampleCli("settxfee", "0.00001")
142-
+ HelpExampleRpc("settxfee", "0.00001")
143-
);
144-
145-
// Amount
146-
int64_t nAmount = 0;
147-
if (params[0].get_real() != 0.0)
148-
nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts
149-
150-
nTransactionFee = nAmount;
151-
return true;
152-
}
153-
154130
Value getrawmempool(const Array& params, bool fHelp)
155131
{
156132
if (fHelp || params.size() > 1)

src/rpcserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ static const CRPCCommand vRPCCommands[] =
237237
{ "getrawmempool", &getrawmempool, true, false, false },
238238
{ "getblock", &getblock, false, false, false },
239239
{ "getblockhash", &getblockhash, false, false, false },
240-
{ "settxfee", &settxfee, false, false, true },
241240
{ "getrawtransaction", &getrawtransaction, false, false, false },
242241
{ "createrawtransaction", &createrawtransaction, false, false, false },
243242
{ "decoderawtransaction", &decoderawtransaction, false, false, false },
@@ -294,6 +293,7 @@ static const CRPCCommand vRPCCommands[] =
294293
{ "listunspent", &listunspent, false, false, true },
295294
{ "lockunspent", &lockunspent, false, false, true },
296295
{ "listlockunspent", &listlockunspent, false, false, true },
296+
{ "settxfee", &settxfee, false, false, true },
297297

298298
/* Wallet-enabled mining */
299299
{ "getgenerate", &getgenerate, true, false, false },

src/rpcwallet.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,3 +2066,28 @@ Value listlockunspent(const Array& params, bool fHelp)
20662066
return ret;
20672067
}
20682068

2069+
Value settxfee(const Array& params, bool fHelp)
2070+
{
2071+
if (fHelp || params.size() < 1 || params.size() > 1)
2072+
throw runtime_error(
2073+
"settxfee amount\n"
2074+
"\nSet the transaction fee. 'amount' is a real and is rounded to the nearest 0.00000001\n"
2075+
"\nArguments:\n"
2076+
"1. amount (numeric, required) The transaction fee in btc rounded to the nearest 0.00000001\n"
2077+
"\nResult\n"
2078+
"true|false (boolean) Returns true if successful\n"
2079+
"\nExamples:\n"
2080+
+ HelpExampleCli("settxfee", "0.00001")
2081+
+ HelpExampleRpc("settxfee", "0.00001")
2082+
);
2083+
2084+
// Amount
2085+
int64_t nAmount = 0;
2086+
if (params[0].get_real() != 0.0)
2087+
nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts
2088+
2089+
nTransactionFee = nAmount;
2090+
return true;
2091+
}
2092+
2093+

0 commit comments

Comments
 (0)