{
 "number": 35317,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35317",
 "title": "wallet: fix ignored subtract_fee_from_outputs option",
 "author": "stutxo",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-05-19T01:11:28Z",
 "updated_at": "2026-08-27T11:30:34Z",
 "age_days": 121,
 "draft": false,
 "labels": [
  "Wallet"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "1b56f3630abb1f3ceffd70e2018387be9137fb1d",
 "head_ref": "wallet-sffo-snake-case",
 "head_repo": "stutxo/bitcoin",
 "head_history": [
  {
   "t": "2026-05-19T21:50:48Z",
   "sha": "1b56f3630abb1f3ceffd70e2018387be9137fb1d"
  }
 ],
 "additions": 57,
 "deletions": 13,
 "changed_files": 3,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "blocked",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": [
    {
     "number": 32857,
     "title": "wallet: allow skipping script paths",
     "author": "Sjors"
    }
   ]
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "achow101",
   "maflcko",
   "sedited"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "blocked",
  "last_author_activity": "2026-06-24T11:26:57Z",
  "last_reviewer_activity": "2026-08-27T11:30:34Z",
  "last_reviewer": "maflcko",
  "author_silent_days": 85,
  "waiting_on_author_days": 21,
  "days_since_update": 21
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": [
   32857
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "The shared wallet funding validation accepts `subtract_fee_from_outputs`, but `fundrawtransaction` and `walletcreatefundedpsbt` previously only read `subtractFeeFromOutputs` when building recipients. This caused the accepted snake_case option to be silently ignored.\n\nThis PR reads either accepted spelling before interpreting subtract-fee outputs, and adds functional coverage for both affected RPCs.\n\nTested:\n\n```bash\nbuild/test/functional/test_runner.py wallet_fundrawtransaction.py",
 "commits": [
  {
   "sha": "8ed3107c385f2cf0993cde61f6a28d7bc7f04a04",
   "date": "2026-05-19T01:10:05Z",
   "message": "wallet: fix ignored subtract_fee_from_outputs option\n\nfundrawtransaction and walletcreatefundedpsbt both type-check the shared subtract_fee_from_outputs option, but previously looked up only subtractFeeFromOutputs when building recipients. This caused the accepted snake_case option to be silently ignored.\n\nRead either accepted spelling before interpreting subtract fee outputs. Add functional coverage for fundrawtransaction and walletcreatefundedpsbt."
  },
  {
   "sha": "1b56f3630abb1f3ceffd70e2018387be9137fb1d",
   "date": "2026-05-19T21:50:28Z",
   "message": "wallet: prefer snake_case funding option names in help"
  }
 ],
 "timeline": [
  {
   "t": "2026-05-19T06:01:28Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nI don't think this is entirely correct. The docs of `walletcreatefundedpsbt` and `fundrawtransaction` don't mention the snake_case at all. So I think the problem here is that undocumented options are silently ignored.\n\nSo I don't think this is the correct fix, because at a minimum this is missing a doc update? Also, I wonder if undocumented options should be rejected in all RPCs? Note that undocumented named args are rejected:\n\n```\nbitcoin-cli -named walletcreatefundedpsbt  unknown_foo=2\nerror code: -8\nerror message:\nUnknown named parameter unknown_foo"
  },
  {
   "t": "2026-05-19T19:39:43Z",
   "kind": "comment",
   "who": "stutxo",
   "assoc": "CONTRIBUTOR",
   "text": "[quoted text omitted]\n\nI agree, this should include a doc update, i can add that, along with the other undocumented snake case aliases that are already accepted.\n\nFor fundrawtransaction and walletcreatefundedpsbt, the missing valid functional options are:\n\n`change_address, change_position, lock_unspents, subtract_fee_from_outputs`\n\n[quoted text omitted]\nHappy to look into making a separate PR to address this, but it might break someones app if they are using the undocumented options already?"
  },
  {
   "t": "2026-05-19T20:04:43Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nYes, but their app is already broken, because it silently ignores those undocumented options. It is generally better to error or warn than to silently ignore."
  },
  {
   "t": "2026-05-19T20:17:01Z",
   "kind": "comment",
   "who": "stutxo",
   "assoc": "CONTRIBUTOR",
   "text": "[quoted text omitted]\n\nTrue but only `subtract_fee_from_outputs` was silently ignored. `change_address`, `change_position`, and `lock_unspents` already work when passed through the `options` object to `fundrawtransaction` and `walletcreatefundedpsbt`, because `FundTransaction` checks both the camelCase and snake_case forms."
  },
  {
   "t": "2026-05-19T20:22:08Z",
   "kind": "comment",
   "who": "stutxo",
   "assoc": "CONTRIBUTOR",
   "text": "Updated the docs with this commit: e58bdfc.\n\nI wasn't exactly sure how to update the docs for both the camelCase and snake_case options. I noticed the only other place with double aliases was verbosity|verbose in getblock(), so I followed the same pattern here.\n\nHowever, it only shows the first name in the help docs, so I thought it might be better to show the updated snake_case option first.\n\nAlternatively, I could list them as separate help entries."
  },
  {
   "t": "2026-05-19T21:50:48Z",
   "kind": "force_push",
   "who": "stutxo",
   "commit": "1b56f3630abb1f3ceffd70e2018387be9137fb1d"
  },
  {
   "t": "2026-05-19T21:58:52Z",
   "kind": "comment",
   "who": "stutxo",
   "assoc": "CONTRIBUTOR",
   "text": "`rpc_help.py` was failing, added the snake case aliases to `vRPCConvertParams` in [1b56f36](https://github.com/bitcoin/bitcoin/commit/1b56f3630abb1f3ceffd70e2018387be9137fb1d)."
  },
  {
   "t": "2026-05-30T00:54:11Z",
   "kind": "comment",
   "who": "achow101",
   "assoc": "MEMBER",
   "text": "Since there are so many RPCs that have (almost) the same set of these arguments, with different mixes of snake case and camel case, I think it would be better for everyone if the argument handling was all unified and that the docs only document the snake case names. For a few releases, all of the RPCs could accept both camel and snake case so that people have ample time to change over, then we could deprecate and remove the camel case args."
  },
  {
   "t": "2026-06-24T11:26:57Z",
   "kind": "comment",
   "who": "stutxo",
   "assoc": "CONTRIBUTOR",
   "text": "[quoted text omitted]\n\nShould i close this PR and open an issue to address this?"
  },
  {
   "t": "2026-08-27T11:06:37Z",
   "kind": "comment",
   "who": "sedited",
   "assoc": "CONTRIBUTOR",
   "text": "[quoted text omitted]\n\nCan't speak for achow, but I think I would prefer that."
  },
  {
   "t": "2026-08-27T11:30:34Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "I guess there is already a tracking issue about the feeRate vs fee_rate stuff. Stuff like `includeWatching` can probably be removed now? For the others that are aliases/mixed there could be a full list, so that it is clear what is affected.\n\nPossibly a linter can be written to avoid this class of problem from getting worse in the future?"
  }
 ],
 "labels_log": [
  {
   "t": "2026-05-19T01:11:31Z",
   "action": "labeled",
   "label": "Wallet",
   "who": "DrahtBot"
  },
  {
   "t": "2026-05-19T21:04:22Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-05-20T09:15:36Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 4213,
 "text_tokens_estimate": 1053,
 "changed_paths": [
  "src/rpc/client.cpp",
  "src/wallet/rpc/spend.cpp",
  "test/functional/wallet_fundrawtransaction.py"
 ],
 "files": [
  {
   "path": "src/rpc/client.cpp",
   "add": 6,
   "del": 0
  },
  {
   "path": "src/wallet/rpc/spend.cpp",
   "add": 20,
   "del": 13
  },
  {
   "path": "test/functional/wallet_fundrawtransaction.py",
   "add": 31,
   "del": 0
  }
 ],
 "test_lines": 31,
 "git": {
  "head": "1b56f3630abb1f3ceffd70e2018387be9137fb1d",
  "head_matches_backup": true,
  "base": "4f348c2d730ce167d2918727aa2fdb6849182ab1",
  "commits": [
   {
    "sha": "8ed3107c38",
    "subject": "wallet: fix ignored subtract_fee_from_outputs option",
    "files": 2,
    "add": 30,
    "del": 2
   },
   {
    "sha": "1b56f3630a",
    "subject": "wallet: prefer snake_case funding option names in help",
    "files": 3,
    "add": 27,
    "del": 11
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "4de123efde0c48e9",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}