{
 "number": 35224,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35224",
 "title": "wallet: importdescriptors should output the request on error",
 "author": "kevkevinpal",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-05-06T16:33:57Z",
 "updated_at": "2026-08-12T08:11:39Z",
 "age_days": 133,
 "draft": true,
 "labels": [
  "Wallet"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "1a24ddb8533b8c87e89df7145eef08df65f7cc4a",
 "head_ref": "importDescriptorsPrintoutRequestOnFailure",
 "head_repo": "kevkevinpal/bitcoin",
 "head_history": [],
 "additions": 11,
 "deletions": 2,
 "changed_files": 2,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "unknown",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": [
    {
     "number": 31668,
     "title": "Added rescan option for import descriptors",
     "author": "saikiran57"
    }
   ]
  }
 },
 "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": []
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "unknown",
  "last_author_activity": "2026-05-06T15:44:24Z",
  "last_reviewer_activity": null,
  "last_reviewer": null,
  "author_silent_days": 134,
  "waiting_on_author_days": 0,
  "days_since_update": 36
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": [
   31668
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "*Waiting for https://github.com/bitcoin/bitcoin/pull/34861 to be merged so I can rebase on it or this can be cherry picked*\n\n## Motivation\nI was motivated by this comment https://github.com/bitcoin/bitcoin/pull/35185#issuecomment-4380232590 because when using the `importdescriptors` rpc on error we should get a more descriptive error message than `Missing required timestamp field for key`. This is because multiple descriptors could be imported, and it would be useful to know the exact request that failed.\n\n## Solution\nInstead of just printing a static error message, `Missing required timestamp field for key` also output the exact request that failed.\n\n## Example\nRequest\n```\n[\n  {\n    \"desc\": \"wpkh([abcd1234/84h/1h/0h]tpub.../0/*)#x9abc123\",\n    \"timestamp\": 1710000000,\n    \"active\": true,\n    \"range\": [0, 100]\n  },\n  {\n    \"desc\": \"wpkh([abcd1234/84h/1h/0h]tpub.../1/*)#y8def456\",\n    \"timestamp\": \"now\",\n    \"internal\": true,\n    \"active\": true,\n    \"range\": [0, 100]\n  },\n  {\n    \"desc\": \"pkh(039dcc64c5c644baf0145a5f7322b16399a01a0ee2a182e3150946fe7946358247)#68u5tv65\",\n    \"active\": false\n  }\n]\n```\n\nBefore\n```\n{\n  \"code\": -3,\n  \"message\": \"Missing required timestamp field for key\"\n}\n```\n\nAfter\n```\n{\n  \"code\": -3,\n  \"message\": \"Missing required timestamp field for import request: {\\\"desc\\\":\\\"pkh(039dcc64c5c644baf0145a5f7322b16399a01a0ee2a182e3150946fe7946358247)#68u5tv65\\\",\\\"active\\\":false}\"\n}\n```\n\nNote: after https://github.com/bitcoin/bitcoin/pull/34861 is merged, the output will be per item.",
 "commits": [
  {
   "sha": "47be83c36fa4d02f479b124239ad1a297291fbdf",
   "date": "2026-05-06T15:43:17Z",
   "message": "wallet: on failure of importdescriptors printout full request on error"
  },
  {
   "sha": "1a24ddb8533b8c87e89df7145eef08df65f7cc4a",
   "date": "2026-05-06T15:44:24Z",
   "message": "test: add coverage for failure of importdescriptors"
  }
 ],
 "timeline": [],
 "labels_log": [
  {
   "t": "2026-05-06T16:34:01Z",
   "action": "labeled",
   "label": "Wallet",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 1701,
 "text_tokens_estimate": 425,
 "changed_paths": [
  "src/wallet/rpc/backup.cpp",
  "test/functional/wallet_importdescriptors.py"
 ],
 "files": [
  {
   "path": "src/wallet/rpc/backup.cpp",
   "add": 1,
   "del": 1
  },
  {
   "path": "test/functional/wallet_importdescriptors.py",
   "add": 10,
   "del": 1
  }
 ],
 "test_lines": 11,
 "git": {
  "head": "1a24ddb8533b8c87e89df7145eef08df65f7cc4a",
  "head_matches_backup": true,
  "base": "d7ed2840acc0f065620fdd3d45480169f06a266c",
  "commits": [
   {
    "sha": "47be83c36f",
    "subject": "wallet: on failure of importdescriptors printout full request on error",
    "files": 1,
    "add": 1,
    "del": 1
   },
   {
    "sha": "1a24ddb853",
    "subject": "test: add coverage for failure of importdescriptors",
    "files": 1,
    "add": 10,
    "del": 1
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "0b3bc6376746a065",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}