rpc: add placeholder annotation for deprecated params
What changed, and why it matters
This commit is a documentation-only metadata change. It adds a new 'placeholder' flag to the internal description of several old, ignored RPC parameters so the help system can label them as kept only for backward compatibility. No code behavior changes, no bug fixes, and no security issue is present.
No action required. This is a non-security metadata/documentation change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces an RPCArgOptions.placeholder boolean in src/rpc/util.h and sets it on deprecated/ignored dummy arguments in prioritisetransaction, submitblock, getbalance, and sendmany. The flag is purely descriptive and does not alter argument parsing, validation, or execution paths. It is not used anywhere else in the diff, so it cannot introduce a runtime vulnerability.
Changed components
src/rpc/util.hsrc/rpc/mining.cppsrc/wallet/rpc/coins.cppsrc/wallet/rpc/spend.cppInspect captured patch +10 / −4
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 1d72c699..4465f3a1 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -536,7 +536,8 @@ static RPCMethod prioritisetransaction()
{
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id."},
{"dummy", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "API-Compatibility for previous API. Must be zero or null.\n"
- " DEPRECATED. For forward compatibility use named arguments and omit this parameter."},
+ " DEPRECATED. For forward compatibility use named arguments and omit this parameter.",
+ RPCArgOptions{.placeholder = true}},
{"fee_delta", RPCArg::Type::NUM, RPCArg::Optional::NO, "The fee value (in satoshis) to add (or subtract, if negative).\n"
" Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.\n"
" The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
@@ -1092,7 +1093,8 @@ static RPCMethod submitblock()
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n",
{
{"hexdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hex-encoded block data to submit"},
- {"dummy", RPCArg::Type::STR, RPCArg::DefaultHint{"ignored"}, "dummy value, for compatibility with BIP22. This value is ignored."},
+ {"dummy", RPCArg::Type::STR, RPCArg::DefaultHint{"ignored"}, "dummy value, for compatibility with BIP22. This value is ignored.",
+ RPCArgOptions{.placeholder = true}},
},
{
RPCResult{"If the block was accepted", RPCResult::Type::NONE, "", ""},
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 82ebea61..70dfd198 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -170,6 +170,7 @@ struct RPCArgOptions {
bool skip_type_check{false};
std::string oneline_description{}; //!< Should be empty unless it is supposed to override the auto-generated summary line
std::vector<std::string> type_str{}; //!< Should be empty unless it is supposed to override the auto-generated type strings. Vector length is either 0 or 2, m_opts.type_str.at(0) will override the type of the value in a key-value pair, m_opts.type_str.at(1) will override the type in the argument description.
+ bool placeholder{false}; //!< If set, the argument is retained only for compatibility and should generally be omitted.
bool hidden{false}; //!< For testing only
bool also_positional{false}; //!< If set allows a named-parameter field in an OBJ_NAMED_PARAM options object
//!< to have the same name as a top-level parameter. By default the RPC
diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp
index ab869b0d..e38cb178 100644
--- a/src/wallet/rpc/coins.cpp
+++ b/src/wallet/rpc/coins.cpp
@@ -169,7 +169,8 @@ RPCMethod getbalance()
"The available balance is what the wallet considers currently spendable, and is\n"
"thus affected by options which limit spendability such as -spendzeroconfchange.\n",
{
- {"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Remains for backward compatibility. Must be excluded or set to \"*\"."},
+ {"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Remains for backward compatibility. Must be excluded or set to \"*\".",
+ RPCArgOptions{.placeholder = true}},
{"minconf", RPCArg::Type::NUM, RPCArg::Default{0}, "Only include transactions confirmed at least this many times."},
{"include_watchonly", RPCArg::Type::BOOL, RPCArg::Default{false}, "No longer used"},
{"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{true}, "(only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction."},
diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp
index 8bb14c47..5686a703 100644
--- a/src/wallet/rpc/spend.cpp
+++ b/src/wallet/rpc/spend.cpp
@@ -342,13 +342,15 @@ RPCMethod sendmany()
{"dummy", RPCArg::Type::STR, RPCArg::Default{"\"\""}, "Must be set to \"\" for backwards compatibility.",
RPCArgOptions{
.oneline_description = "\"\"",
+ .placeholder = true,
}},
{"amounts", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::NO, "The addresses and amounts",
{
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The bitcoin address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value"},
},
},
- {"minconf", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "Ignored dummy value"},
+ {"minconf", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "Ignored dummy value",
+ RPCArgOptions{.placeholder = true}},
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "A comment"},
{"subtractfeefrom", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "The addresses.\n"
"The fee will be equally deducted from the amount of each selected address.\n"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.