rpc, wallet: use the same `next_index` key in `listdescriptors` and `importdescriptors` #26194

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:next_index_listdescriptors changing 3 files +12 −4
  1. w0xlt commented at 3:15 PM on September 28, 2022: contributor

    Currently listdescriptors RPC uses next key to represent WalletDescriptor::next_index while importdescriptors uses next_index. This creates two different descriptor formats.

    This PR changes listdescriptors to use the same key as importdescriptors.

  2. DrahtBot commented at 5:50 PM on September 28, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK aureleoules, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  3. furszy commented at 6:19 PM on September 28, 2022: member

    As it's an API change, probably should add it to the release-notes.

  4. in src/wallet/rpc/backup.cpp:1852 in 80517c6083 outdated
    1846 | @@ -1847,7 +1847,7 @@ RPCHelpMan listdescriptors()
    1847 |              range.push_back(info.range->first);
    1848 |              range.push_back(info.range->second - 1);
    1849 |              spk.pushKV("range", range);
    1850 | -            spk.pushKV("next", info.next_index);
    1851 | +            spk.pushKV("next_index", info.next_index);
    


    luke-jr commented at 1:04 AM on October 1, 2022:

    There should be some compatibility at least for a release or two.


  5. luke-jr changes_requested
  6. w0xlt force-pushed on Nov 1, 2022
  7. w0xlt commented at 10:42 PM on November 1, 2022: contributor

    https://github.com/bitcoin/bitcoin/pull/26194/commits/b9ea106f1da4e018ec4876d8e5b1209401ace382 adds the next_index instead of replacing next as suggested in #26194 (review) for compatibility reasons and adds the release notes as suggested in #26194 (comment).

  8. aureleoules approved
  9. aureleoules commented at 10:47 AM on November 2, 2022: member

    ACK b9ea106f1da4e018ec4876d8e5b1209401ace382

  10. rpc, wallet: use the same `next_index` in listdescriptors and importdescriptors b082f28101
  11. in src/wallet/rpc/backup.cpp:1774 in b9ea106f1d outdated
    1771 | @@ -1772,6 +1772,7 @@ RPCHelpMan listdescriptors()
    1772 |                          {RPCResult::Type::NUM, "", "Range end inclusive"},
    1773 |                      }},
    1774 |                      {RPCResult::Type::NUM, "next", /*optional=*/true, "The next index to generate addresses from; defined only for ranged descriptors"},
    


    maflcko commented at 11:59 AM on November 14, 2022:

    If this is kept for compatibility, it might be good to mention it, and that the value is equal to the other. Otherwise users might be confused to see the same field twice and wonder what the difference is?


  12. w0xlt force-pushed on Dec 6, 2022
  13. aureleoules approved
  14. aureleoules commented at 12:51 PM on January 2, 2023: member

    reACK b082f28101773e0ef0281d97025e65d0364d6f29

  15. fanquake requested review from achow101 on Feb 8, 2023
  16. achow101 commented at 5:08 PM on March 8, 2023: member

    ACK b082f28101773e0ef0281d97025e65d0364d6f29

  17. DrahtBot removed review request from achow101 on Mar 8, 2023
  18. achow101 merged this on Mar 8, 2023
  19. achow101 closed this on Mar 8, 2023

  20. sidhujag referenced this in commit 3e32619ce1 on Mar 8, 2023
  21. bitcoin locked this on Mar 7, 2024

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-04-21 00:13 UTC

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