This mostly removes a no-op and meaningless bool fallback in the fundrawtransaction RPC.
This allows to remove a skip_type_check.
Also, this makes validating the JSON schema from #34683 more consistent.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35836.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline and AI policy for information on the review process. A summary of reviews will appear here.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):
RPCTypeCheckObj(options, {...}, true, true) in src/wallet/rpc/spend.cpp<sup>2026-07-30 07:01:32</sup>
The fallback was added in commit
af4fe7fd126eff2dd1942276ea91c8ab9dd717c6, more than a decade ago.
However, it is irrelevant, given that watch-only wallet is not a concept
anymore after commit 1337c72198a7d32935431d64e9e58c12f9003abc.
So remove the code.
Can be reviewed with the --ignore-all-space option.
Rendered diff:
diff --git a/getopenrpcinfo.full.json b/getopenrpcinfo.full.json
index 301098f..f922401 100644
--- a/getopenrpcinfo.full.json
+++ b/getopenrpcinfo.full.json
@@ -2914,33 +2914,197 @@
{
"name": "fundrawtransaction",
"description": "If the transaction has no inputs, they will be automatically selected to meet its out value.\nIt will add at most one change output to the outputs.\nNo existing outputs will be modified unless \"subtractFeeFromOutputs\" is specified.\nNote that inputs which were signed may need to be resigned after completion since in/outputs have been added.\nThe inputs added will not be signed, use signrawtransactionwithkey\nor signrawtransactionwithwallet for that.\nAll existing inputs must either have their previous output transaction be in the wallet\nor be in the UTXO set. Solving data must be provided for non-wallet inputs.\nNote that all inputs selected must be of standard form and P2SH scripts must be\nin the wallet using importdescriptors (to calculate fees).\nYou can see whether this is the case by checking the \"solvable\" field in the listunspent output.\nNote that if specifying an exact fee rate, the resulting transaction may have a higher fee rate\nif the transaction has unconfirmed inputs. This is because the wallet will attempt to make the\nentire package have the given fee rate, not the resulting transaction.",
"params": [
{
"name": "hexstring",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-fA-F]+$"
},
"description": "The hex string of the raw transaction"
},
{
"name": "options",
"required": false,
- "schema": {}
+ "schema": {
+ "type": "object",
+ "properties": {
+ "add_inputs": {
+ "type": "boolean",
+ "default": true,
+ "description": "For a transaction with existing inputs, automatically include more if they are not enough."
+ },
+ "include_unsafe": {
+ "type": "boolean",
+ "default": false,
+ "description": "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\nWarning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\nIf that happens, you will need to fund the transaction with different inputs and republish it."
+ },
+ "minconf": {
+ "type": "number",
+ "default": 0,
+ "description": "If add_inputs is specified, require inputs with at least this many confirmations."
+ },
+ "maxconf": {
+ "type": "number",
+ "description": "If add_inputs is specified, require inputs with at most this many confirmations."
+ },
+ "changeAddress": {
+ "type": "string",
+ "x-bitcoin-default-hint": "automatic",
+ "description": "The bitcoin address to receive the change"
+ },
+ "changePosition": {
+ "type": "number",
+ "x-bitcoin-default-hint": "random",
+ "description": "The index of the change output"
+ },
+ "change_type": {
+ "type": "string",
+ "x-bitcoin-default-hint": "set by -changetype",
+ "description": "The output type to use. Only valid if changeAddress is not specified. Options are \"legacy\", \"p2sh-segwit\", \"bech32\", \"bech32m\"."
+ },
+ "includeWatching": {
+ "type": "boolean",
+ "default": false,
+ "description": "(DEPRECATED) No longer used"
+ },
+ "lockUnspents": {
+ "type": "boolean",
+ "default": false,
+ "description": "Lock selected unspent outputs"
+ },
+ "fee_rate": {
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "x-bitcoin-default-hint": "not set, fall back to wallet fee estimation",
+ "description": "Specify a fee rate in sat/vB."
+ },
+ "feeRate": {
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "x-bitcoin-default-hint": "not set, fall back to wallet fee estimation",
+ "description": "Specify a fee rate in BTC/kvB."
+ },
+ "subtractFeeFromOutputs": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ },
+ "default": [],
+ "description": "The integers.\nThe fee will be equally deducted from the amount of each specified output.\nThose recipients will receive less bitcoins than you enter in their corresponding amount field.\nIf no outputs are specified here, the sender pays the fee."
+ },
+ "input_weights": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "txid": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]+$",
+ "description": "The transaction id"
+ },
+ "vout": {
+ "type": "number",
+ "description": "The output index"
+ },
+ "weight": {
+ "type": "number",
+ "description": "The maximum weight for this input, including the weight of the outpoint and sequence number. Note that serialized signature sizes are not guaranteed to be consistent, so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures.Remember to convert serialized sizes to weight units when necessary."
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "txid",
+ "vout",
+ "weight"
+ ]
+ },
+ "description": "Inputs and their corresponding weights"
+ },
+ "max_tx_weight": {
+ "type": "number",
+ "default": 400000,
+ "description": "The maximum acceptable transaction weight.\nTransaction building will fail if this can not be satisfied."
+ },
+ "conf_target": {
+ "type": "number",
+ "x-bitcoin-default-hint": "wallet -txconfirmtarget",
+ "description": "Confirmation target in blocks",
+ "x-bitcoin-also-positional": true
+ },
+ "estimate_mode": {
+ "type": "string",
+ "default": "unset",
+ "description": "The fee estimate mode, must be one of (case insensitive):\nunset, economical, conservative \nunset means no mode set (economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used). \neconomical estimates use a shorter time horizon, making them more\nresponsive to short-term drops in the prevailing fee market. This mode\npotentially returns a lower fee rate estimate.\nconservative estimates use a longer time horizon, making them\nless responsive to short-term drops in the prevailing fee market. This mode\npotentially returns a higher fee rate estimate.\n",
+ "x-bitcoin-also-positional": true
+ },
+ "replaceable": {
+ "type": "boolean",
+ "x-bitcoin-default-hint": "wallet default",
+ "description": "Marks this transaction as BIP125-replaceable.\nAllows this transaction to be replaced by a transaction with higher fees"
+ },
+ "solving_data": {
+ "type": "object",
+ "properties": {
+ "pubkeys": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]+$"
+ },
+ "default": [],
+ "description": "Public keys involved in this transaction."
+ },
+ "scripts": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]+$"
+ },
+ "default": [],
+ "description": "Scripts involved in this transaction."
+ },
+ "descriptors": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "default": [],
+ "description": "Descriptors that provide solving data for this transaction."
+ }
+ },
+ "additionalProperties": false,
+ "description": "Keys and scripts needed for producing a final transaction with a dummy signature.\nUsed for fee estimation during coin selection."
+ }
+ },
+ "additionalProperties": false
+ }
},
{
"name": "iswitness",
"required": false,
"schema": {
"type": "boolean",
"x-bitcoin-default-hint": "depends on heuristic tests"
},
"description": "Whether the transaction hex is a serialized witness transaction.\nIf iswitness is not present, heuristic tests will be used in decoding.\nIf true, only witness deserialization will be tried.\nIf false, only non-witness deserialization will be tried.\nThis boolean should reflect whether the transaction has inputs\n(e.g. fully valid, or on-chain transactions), if known by the caller."
}
],
"result": {
"name": "result",
"schema": {
"type": "object",
"properties": {
~To get more context, in the past fundrawtransaction only took two arguments, rawtx and includeWatching?~
Oh wait sorry, didn't see the two commits mentioned in the commit message :)
The question is, are we breaking backwards compatibility be removing that type check and disabling using a bool as second argument? Even if it is irrelevant, could be that someone still uses it?
The question is, are we breaking backwards compatibility be removing that type check and disabling using a bool as second argument? Even if it is irrelevant, could be that someone still uses it?
This is not removing a type check, it is removing a skipped type check. That is, it is adding a type check (both in the server and the openrpc spec). Yes, in theory someone could be using this dummy bool. However, adding the type check here is useful, because: