Skip to content

Commit 5af6572

Browse files
committed
Merge #10698: Be consistent in calling transactions "replaceable" for Opt-In RBF
73c942e Use "replaceable" instead of "rbfoptin" in bitcoin-tx. (Matt Corallo) fb915d5 Use "replaceable" instead of "optIntoRbf" in fundrawtransaction. (Matt Corallo) 928c681 Use "replaceable" instead of "optintorbf" in createrawtransaction. (Matt Corallo) Tree-SHA512: 8922451c00abb63aaa08b4a9e314e89c22233b32f207259fbc25367f7d5b67efbaccc7e2a4958c18611ad498da302296242860c7be965a0e996dcde3e89efa07
2 parents 30bc0f6 + 73c942e commit 5af6572

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/bitcoin-tx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int AppInitRawTx(int argc, char* argv[])
7777
strUsage += HelpMessageOpt("in=TXID:VOUT(:SEQUENCE_NUMBER)", _("Add input to TX"));
7878
strUsage += HelpMessageOpt("locktime=N", _("Set TX lock time to N"));
7979
strUsage += HelpMessageOpt("nversion=N", _("Set TX version to N"));
80-
strUsage += HelpMessageOpt("rbfoptin(=N)", _("Set RBF opt-in sequence number for input N (if not provided, opt-in all available inputs)"));
80+
strUsage += HelpMessageOpt("replaceable(=N)", _("Set RBF opt-in sequence number for input N (if not provided, opt-in all available inputs)"));
8181
strUsage += HelpMessageOpt("outaddr=VALUE:ADDRESS", _("Add address-based output to TX"));
8282
strUsage += HelpMessageOpt("outpubkey=VALUE:PUBKEY[:FLAGS]", _("Add pay-to-pubkey output to TX") + ". " +
8383
_("Optionally add the \"W\" flag to produce a pay-to-witness-pubkey-hash output") + ". " +
@@ -673,7 +673,7 @@ static void MutateTx(CMutableTransaction& tx, const std::string& command,
673673
MutateTxVersion(tx, commandVal);
674674
else if (command == "locktime")
675675
MutateTxLocktime(tx, commandVal);
676-
else if (command == "rbfoptin") {
676+
else if (command == "replaceable") {
677677
MutateTxRBFOptIn(tx, commandVal);
678678
}
679679

src/rpc/client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
8686
{ "createrawtransaction", 0, "inputs" },
8787
{ "createrawtransaction", 1, "outputs" },
8888
{ "createrawtransaction", 2, "locktime" },
89-
{ "createrawtransaction", 3, "optintorbf" },
89+
{ "createrawtransaction", 3, "replaceable" },
9090
{ "signrawtransaction", 1, "prevtxs" },
9191
{ "signrawtransaction", 2, "privkeys" },
9292
{ "sendrawtransaction", 1, "allowhighfees" },

src/rpc/rawtransaction.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
294294
{
295295
if (request.fHelp || request.params.size() < 2 || request.params.size() > 4)
296296
throw std::runtime_error(
297-
"createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,\"data\":\"hex\",...} ( locktime ) ( optintorbf )\n"
297+
"createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,\"data\":\"hex\",...} ( locktime ) ( replaceable )\n"
298298
"\nCreate a transaction spending the given inputs and creating new outputs.\n"
299299
"Outputs can be addresses or data.\n"
300300
"Returns hex-encoded raw transaction.\n"
@@ -318,7 +318,8 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
318318
" ,...\n"
319319
" }\n"
320320
"3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs\n"
321-
"4. optintorbf (boolean, optional, default=false) Allow this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.\n"
321+
"4. replaceable (boolean, optional, default=false) Marks this transaction as BIP125 replaceable.\n"
322+
" Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.\n"
322323
"\nResult:\n"
323324
"\"transaction\" (string) hex string of the transaction\n"
324325

@@ -412,7 +413,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
412413
}
413414

414415
if (request.params.size() > 3 && rbfOptIn != SignalsOptInRBF(rawTx)) {
415-
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter combination: Sequence number(s) contradict optintorbf option");
416+
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter combination: Sequence number(s) contradict replaceable option");
416417
}
417418

418419
return EncodeHexTx(rawTx);
@@ -900,7 +901,7 @@ static const CRPCCommand commands[] =
900901
{ // category name actor (function) okSafeMode
901902
// --------------------- ------------------------ ----------------------- ----------
902903
{ "rawtransactions", "getrawtransaction", &getrawtransaction, true, {"txid","verbose"} },
903-
{ "rawtransactions", "createrawtransaction", &createrawtransaction, true, {"inputs","outputs","locktime"} },
904+
{ "rawtransactions", "createrawtransaction", &createrawtransaction, true, {"inputs","outputs","locktime","replaceable"} },
904905
{ "rawtransactions", "decoderawtransaction", &decoderawtransaction, true, {"hexstring"} },
905906
{ "rawtransactions", "decodescript", &decodescript, true, {"hexstring"} },
906907
{ "rawtransactions", "sendrawtransaction", &sendrawtransaction, false, {"hexstring","allowhighfees"} },

src/wallet/rpcwallet.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,8 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
26562656
" Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
26572657
" If no outputs are specified here, the sender pays the fee.\n"
26582658
" [vout_index,...]\n"
2659-
" \"optIntoRbf\" (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees\n"
2659+
" \"replaceable\" (boolean, optional) Marks this transaction as BIP125 replaceable.\n"
2660+
" Allows this transaction to be replaced by a transaction with higher fees\n"
26602661
" }\n"
26612662
" for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n"
26622663
"\nResult:\n"
@@ -2708,7 +2709,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
27082709
{"reserveChangeKey", UniValueType(UniValue::VBOOL)},
27092710
{"feeRate", UniValueType()}, // will be checked below
27102711
{"subtractFeeFromOutputs", UniValueType(UniValue::VARR)},
2711-
{"optIntoRbf", UniValueType(UniValue::VBOOL)},
2712+
{"replaceable", UniValueType(UniValue::VBOOL)},
27122713
},
27132714
true, true);
27142715

@@ -2742,8 +2743,8 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
27422743
if (options.exists("subtractFeeFromOutputs"))
27432744
subtractFeeFromOutputs = options["subtractFeeFromOutputs"].get_array();
27442745

2745-
if (options.exists("optIntoRbf")) {
2746-
coinControl.signalRbf = options["optIntoRbf"].get_bool();
2746+
if (options.exists("replaceable")) {
2747+
coinControl.signalRbf = options["replaceable"].get_bool();
27472748
}
27482749
}
27492750
}

0 commit comments

Comments
 (0)