227 | @@ -228,7 +228,7 @@ static RPCHelpMan getrawtransaction()
228 | "If verbosity is 1, returns a JSON Object with information about the transaction.\n"
229 | "If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.",
230 | {
231 | - {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
232 | + {"txid|wtxid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (txid or wtxid)"},
I think stuffing two types into one field makes the RPC worse. Do we have a good rationale to do so, instead of adding wtxid as an additional parameter?
The main benefit I see is probably that it keeps the positional cli interface simpler, but I'm not sure that tradeoff is worth it, when cli supports named args, and it doesn't seem like this has bothered human/ad-hoc users so far?
I kept the signature the same to ensure minimal changes where possible for consistency.
A single parameter is simpler for the caller — they just pass a hash and it resolves. Adding a separate parameter forces the caller to know upfront which type they have.
I see the argument for a separate parameter — happy to refactor if you feel strongly about it.