wallet: importdescriptors should output the request on error #35224

pull kevkevinpal wants to merge 2 commits into bitcoin:master from kevkevinpal:importDescriptorsPrintoutRequestOnFailure changing 2 files +11 −2
  1. kevkevinpal commented at 4:33 PM on May 6, 2026: contributor

    Waiting for #35185 to be merged so I can rebase on it

    Motivation

    I was motivated by this comment #35185 (comment) 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.

    Solution

    Instead of just printing a static error message, Missing required timestamp field for key also output the exact request that failed.

    Example

    Request

    [
      {
        "desc": "wpkh([abcd1234/84h/1h/0h]tpub.../0/*)#x9abc123",
        "timestamp": 1710000000,
        "active": true,
        "range": [0, 100]
      },
      {
        "desc": "wpkh([abcd1234/84h/1h/0h]tpub.../1/*)#y8def456",
        "timestamp": "now",
        "internal": true,
        "active": true,
        "range": [0, 100]
      },
      {
        "desc": "pkh(039dcc64c5c644baf0145a5f7322b16399a01a0ee2a182e3150946fe7946358247)#68u5tv65",
        "active": false
      }
    ]
    

    Before

    {
      "code": -3,
      "message": "Missing required timestamp field for key"
    }
    

    After

    {
      "code": -3,
      "message": "Missing required timestamp field for import request: {\"desc\":\"pkh(039dcc64c5c644baf0145a5f7322b16399a01a0ee2a182e3150946fe7946358247)#68u5tv65\",\"active\":false}"
    }
    

    Note: after #35185 is merged, the output will be per item.

  2. wallet: on failure of importdescriptors printout full request on error 47be83c36f
  3. test: add coverage for failure of importdescriptors 1a24ddb853
  4. DrahtBot added the label Wallet on May 6, 2026
  5. DrahtBot commented at 4:34 PM on May 6, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35224.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-07 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me