wallet: importdescriptors should output the request on error #35224

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

    Motivation

    When importdescriptors is given multiple requests, a missing timestamp still fails the whole call with a static error (Missing required timestamp field for key). That does not say which request failed.

    #34861 is merged. Other parse failures are returned per item, but a missing or invalid timestamp is still a top-level RPC error from GetImportTimestamp.

    Solution

    Include the failing request in that error message.

    Example

    Request

    [
      {
        "desc": "wpkh([abcd1234/84h/1h/0h]tpub.../0/*)#x9abc123",
        "timestamp": 1710000000,
        "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}"
    }
    
  2. DrahtBot added the label Wallet on May 6, 2026
  3. 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-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31668 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/31668.svg"></sub> (Added rescan option for import descriptors by saikiran57)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. kevkevinpal force-pushed on Oct 10, 2026
  5. wallet: include the failing importdescriptors request when timestamp is missing
    A missing timestamp still fails the whole call, so put the request JSON in the error so a multi-request import identifies which item failed.
    1f10516a1f
  6. kevkevinpal force-pushed on Oct 10, 2026
  7. DrahtBot added the label CI failed on Oct 10, 2026
  8. kevkevinpal marked this as ready for review on Oct 10, 2026
  9. kevkevinpal commented at 2:34 PM on October 10, 2026: contributor

    CI / 32 bit ARM (pull_request) failing seems unrelated to the change

  10. DrahtBot removed the label CI failed on Oct 15, 2026

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-10-18 10:51 UTC

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