rpc: Correct OpenRPC default metadata
What changed, and why it matters
This commit fixes documentation metadata for six Bitcoin Core RPC arguments. It changes how default values are described so that automatically generated API docs and schemas are accurate. The actual behavior of the software when running is unchanged, so there is no direct security risk to users.
No security action required. This is a documentation/schema correctness fix. Treat as a normal maintenance patch.
Security signals we found
No runtime code changes
Only RPC help/schema metadata modified
Vendor explicitly states runtime behavior is unchanged
Fixes schema inconsistency (boolean default typed as string)
Corrects misleading default value descriptions
Evidence from the diff
The patch updates RPC argument metadata from RPCArg::Default to RPCArg::DefaultHint for arguments whose ‘default’ is a description of fallback behavior rather than a literal accepted value (getdeploymentinfo blockhash, sighashtype in signrawtransactionwithkey/signrawtransactionwithwallet/descriptorprocesspsbt/walletprocesspsbt). It also changes send’s include_watching default from the string “false” to the boolean false so the generated OpenRPC schema is internally consistent. The commit message explicitly states ‘Runtime behavior is unchanged.’
Changed components
src/rpc/blockchain.cppsrc/rpc/rawtransaction.cppsrc/wallet/rpc/spend.cppOpenRPC schema generationRPC help textInspect captured patch +6 / −6
### src/rpc/blockchain.cpp
@@ -1548,7 +1548,7 @@ RPCMethod getdeploymentinfo()
"Returns an object containing various state info regarding deployments of consensus changes.\n"
"Consensus changes for which the new rules are enforced from genesis are not listed in \"deployments\".",
{
- {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Default{"hash of current chain tip"}, "The block hash at which to query deployment state"},
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"hash of current chain tip"}, "The block hash at which to query deployment state"},
},
RPCResult{
RPCResult::Type::OBJ, "", "", {
### src/rpc/rawtransaction.cpp
@@ -743,7 +743,7 @@ static RPCMethod signrawtransactionwithkey()
},
},
},
- {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type. Must be one of:\n"
+ {"sighashtype", RPCArg::Type::STR, RPCArg::DefaultHint{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type. Must be one of:\n"
" \"DEFAULT\"\n"
" \"ALL\"\n"
" \"NONE\"\n"
@@ -2095,7 +2095,7 @@ RPCMethod descriptorprocesspsbt()
{"range", RPCArg::Type::RANGE, RPCArg::Default{1000}, "Up to what index HD chains should be explored (either end or [begin,end])"},
}},
}},
- {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
+ {"sighashtype", RPCArg::Type::STR, RPCArg::DefaultHint{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
" \"DEFAULT\"\n"
" \"ALL\"\n"
" \"NONE\"\n"
### src/wallet/rpc/spend.cpp
@@ -864,7 +864,7 @@ RPCMethod signrawtransactionwithwallet()
},
},
},
- {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type. Must be one of\n"
+ {"sighashtype", RPCArg::Type::STR, RPCArg::DefaultHint{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type. Must be one of\n"
" \"DEFAULT\"\n"
" \"ALL\"\n"
" \"NONE\"\n"
@@ -1207,7 +1207,7 @@ RPCMethod send()
{"change_position", RPCArg::Type::NUM, RPCArg::DefaultHint{"random"}, "The index of the change output"},
{"change_type", RPCArg::Type::STR, RPCArg::DefaultHint{"set by -changetype"}, "The output type to use. Only valid if change_address is not specified. Options are " + FormatAllOutputTypes() + "."},
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB.", RPCArgOptions{.also_positional = true}},
- {"include_watching", RPCArg::Type::BOOL, RPCArg::Default{"false"}, "(DEPRECATED) No longer used"},
+ {"include_watching", RPCArg::Type::BOOL, RPCArg::Default{false}, "(DEPRECATED) No longer used"},
{"inputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "Specify inputs instead of adding them automatically.",
{
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", {
@@ -1597,7 +1597,7 @@ RPCMethod walletprocesspsbt()
{
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction base64 string"},
{"sign", RPCArg::Type::BOOL, RPCArg::Default{true}, "Also sign the transaction when updating (requires wallet to be unlocked)"},
- {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
+ {"sighashtype", RPCArg::Type::STR, RPCArg::DefaultHint{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
" \"DEFAULT\"\n"
" \"ALL\"\n"
" \"NONE\"\n"Why this scored 20/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.