Skip to content

Commit 8a20cd3

Browse files
committed
prioritisetransaction RPC: Restore compatibility with existing implementations by using satoshis for fee offset rather than BTC
1 parent 89151d9 commit 8a20cd3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/rpcmining.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ Value getmininginfo(const Array& params, bool fHelp)
266266
}
267267

268268

269+
// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts
269270
Value prioritisetransaction(const Array& params, bool fHelp)
270271
{
271272
if (fHelp || params.size() != 3)
@@ -277,22 +278,20 @@ Value prioritisetransaction(const Array& params, bool fHelp)
277278
"2. priority delta (numeric, required) The priority to add or subtract.\n"
278279
" The transaction selection algorithm considers the tx as it would have a higher priority.\n"
279280
" (priority of a transaction is calculated: coinage * value_in_satoshis / txsize) \n"
280-
"3. fee delta (numeric, required) The absolute fee value to add or subtract in bitcoin.\n"
281+
"3. fee delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n"
281282
" The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
282283
" considers the transaction as it would have paid a higher (or lower) fee.\n"
283284
"\nResult\n"
284285
"true (boolean) Returns true\n"
285286
"\nExamples:\n"
286-
+ HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 0.00010000")
287-
+ HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 0.00010000")
287+
+ HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 10000")
288+
+ HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000")
288289
);
289290

290291
uint256 hash;
291292
hash.SetHex(params[0].get_str());
292293

293-
CAmount nAmount = 0;
294-
if (params[2].get_real() != 0.0)
295-
nAmount = AmountFromValue(params[2]);
294+
CAmount nAmount = params[2].get_int64();
296295

297296
mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), nAmount);
298297
return true;

0 commit comments

Comments
 (0)