Skip to content

Commit aaa7076

Browse files
committed
Merge pull request #4531
ebdcc36 Add helptexts for -whitelist and rpc prioritisetransaction and switch to bitcoin instead of satoshis (Cozz Lovan)
2 parents c5eabde + ebdcc36 commit aaa7076

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ std::string HelpMessage(HelpMessageMode mode)
262262
#endif
263263
strUsage += " -whitebind=<addr> " + _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6") + "\n";
264264
strUsage += " -whitelist=<netmask> " + _("Whitelist peers connecting from the given netmask or ip. Can be specified multiple times.") + "\n";
265+
strUsage += " " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway") + "\n";
265266

266267
#ifdef ENABLE_WALLET
267268
strUsage += "\n" + _("Wallet options:") + "\n";

src/rpcclient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
8585
{ "getrawmempool", 0 },
8686
{ "estimatefee", 0 },
8787
{ "estimatepriority", 0 },
88+
{ "prioritisetransaction", 1 },
89+
{ "prioritisetransaction", 2 },
8890
};
8991

9092
class CRPCConvertTable

src/rpcmining.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,30 @@ Value prioritisetransaction(const Array& params, bool fHelp)
252252
if (fHelp || params.size() != 3)
253253
throw runtime_error(
254254
"prioritisetransaction <txid> <priority delta> <fee delta>\n"
255-
"Accepts the transaction into mined blocks at a higher (or lower) priority");
255+
"Accepts the transaction into mined blocks at a higher (or lower) priority\n"
256+
"\nArguments:\n"
257+
"1. \"txid\" (string, required) The transaction id.\n"
258+
"2. priority delta (numeric, required) The priority to add or subtract.\n"
259+
" The transaction selection algorithm considers the tx as it would have a higher priority.\n"
260+
" (priority of a transaction is calculated: coinage * value_in_satoshis / txsize) \n"
261+
"3. fee delta (numeric, required) The absolute fee value to add or subtract in bitcoin.\n"
262+
" The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
263+
" considers the transaction as it would have paid a higher (or lower) fee.\n"
264+
"\nResult\n"
265+
"true (boolean) Returns true\n"
266+
"\nExamples:\n"
267+
+ HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 0.00010000")
268+
+ HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 0.00010000")
269+
);
256270

257271
uint256 hash;
258272
hash.SetHex(params[0].get_str());
259-
mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), params[2].get_int64());
273+
274+
int64_t nAmount = 0;
275+
if (params[2].get_real() != 0.0)
276+
nAmount = AmountFromValue(params[2]);
277+
278+
mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), nAmount);
260279
return true;
261280
}
262281

0 commit comments

Comments
 (0)