Update keypoolrefill RPC docs to make it clear that descriptor wallets have 4 ScriptPubKeyManagers by default and each of them is updated in this command, as suggested #29924 (comment)
docs: Improve `keypoolrefill` RPC docs #32429
pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:keypoolrefill_docs changing 1 files +2 −1-
w0xlt commented at 7:15 PM on May 6, 2025: contributor
-
DrahtBot commented at 7:15 PM on May 6, 2025: 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/32429.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
- DrahtBot added the label Docs on May 6, 2025
-
in src/wallet/rpc/addresses.cpp:340 in 9e20f6ba68 outdated
335 | @@ -336,7 +336,9 @@ RPCHelpMan addmultisigaddress() 336 | RPCHelpMan keypoolrefill() 337 | { 338 | return RPCHelpMan{"keypoolrefill", 339 | - "\nFills the keypool."+ 340 | + "\nRefills each `ScriptPubKeyManager` keypool in the wallet up to the specified number of new keys.\n" 341 | + "By default, descriptor wallets have four `ScriptPubKeyManagers` (`wpkh`, `tr`, `pkh`, and `sh-wpkh`), each with 1000 entries.\n"
maflcko commented at 8:43 PM on May 6, 2025:Should probably use
DEFAULT_KEYPOOL_SIZEinstead of hardcoded 1000? Same for theOUTPUT_TYPES? Also,ScriptPubKeyManagerswas never used in user-facing docs, except for one error message. Maybe just use "active ranged descriptor" (or similar)?
w0xlt commented at 11:37 PM on May 6, 2025:Done (for
DEFAULT_KEYPOOL_SIZEandScriptPubKeyManagers). RegardingOUTPUT_TYPES, I think it may need to be refactored to include it in the RPC documentation due to static initialization. But for now, I leftkeypoolrefillexactly asgetnewaddress.
w0xlt commented at 3:17 AM on May 7, 2025:OUTPUT_TYPEShandled in https://github.com/bitcoin/bitcoin/pull/32432in src/wallet/rpc/addresses.cpp:341 in 9e20f6ba68 outdated
335 | @@ -336,7 +336,9 @@ RPCHelpMan addmultisigaddress() 336 | RPCHelpMan keypoolrefill() 337 | { 338 | return RPCHelpMan{"keypoolrefill", 339 | - "\nFills the keypool."+ 340 | + "\nRefills each `ScriptPubKeyManager` keypool in the wallet up to the specified number of new keys.\n" 341 | + "By default, descriptor wallets have four `ScriptPubKeyManagers` (`wpkh`, `tr`, `pkh`, and `sh-wpkh`), each with 1000 entries.\n" 342 | + "Legacy wallet typically uses a single `LegacyScriptPubKeyMan` (which manages both external and internal keypools)\n"+
maflcko commented at 9:07 PM on May 6, 2025:also, now that bdb was removed, no need to add docs for it?
w0xlt commented at 11:37 PM on May 6, 2025:Done. Thanks.
w0xlt force-pushed on May 6, 2025w0xlt force-pushed on May 6, 2025in src/wallet/rpc/addresses.cpp:339 in cd00fb85e9 outdated
335 | @@ -336,7 +336,8 @@ RPCHelpMan addmultisigaddress() 336 | RPCHelpMan keypoolrefill() 337 | { 338 | return RPCHelpMan{"keypoolrefill", 339 | - "\nFills the keypool."+ 340 | + "\nRefills each descriptor keypool in the wallet up to the specified number of new keys.\n"
maflcko commented at 7:46 AM on May 7, 2025:"Refills each descriptor keypool in the wallet up to the specified number of new keys.\n"nit: This is trimmed anyway.
w0xlt commented at 5:45 PM on May 7, 2025:in src/wallet/rpc/addresses.cpp:340 in cd00fb85e9 outdated
335 | @@ -336,7 +336,8 @@ RPCHelpMan addmultisigaddress() 336 | RPCHelpMan keypoolrefill() 337 | { 338 | return RPCHelpMan{"keypoolrefill", 339 | - "\nFills the keypool."+ 340 | + "\nRefills each descriptor keypool in the wallet up to the specified number of new keys.\n" 341 | + "By default, descriptor wallets have 4 active ranged descriptors (\"legacy\", \"p2sh-segwit\", \"bech32\", and \"bech32m\"), each with " + std::to_string(DEFAULT_KEYPOOL_SIZE) + " entries.\n" +
w0xlt commented at 5:45 PM on May 7, 2025:rkrux approvedrkrux commented at 10:49 AM on May 7, 2025: contributorACK cd00fb85e9e0997120715e68374462cff0dad7eb given the suggestions are addressed.
I checked that by default there are 4 scriptpubkeymans setup on the first run of the wallet inside
SetupDescriptorScriptPubKeyMans. Also, ack because the lack of this information has caused an issue to be created.docs: Improve `keypoolrefill` RPC docs ff35a4b021w0xlt force-pushed on May 7, 2025brunoerg approvedbrunoerg commented at 5:48 PM on May 7, 2025: contributorcode review ACK ff35a4b021e12ae33e28c01ffeeb2c1916f7a487
DrahtBot requested review from rkrux on May 7, 2025achow101 commented at 9:44 PM on May 7, 2025: memberACK ff35a4b021e12ae33e28c01ffeeb2c1916f7a487
achow101 merged this on May 7, 2025achow101 closed this on May 7, 2025stickies-v referenced this in commit 772a33e052 on May 23, 2025sedited referenced this in commit cb3cd9b8b9 on May 29, 2025luke-jr referenced this in commit 3ca2b01605 on Jun 6, 2025achow101 referenced this in commit f33154c464 on Jul 1, 2025yuvicc referenced this in commit 069643f094 on Jul 6, 2025bug-castercv502 referenced this in commit 2858098810 on Sep 28, 2025Kino1994 referenced this in commit a4c7b958f2 on Jun 28, 2026Kino1994 referenced this in commit ed9fc2d410 on Jun 28, 2026BigcoinBGC referenced this in commit facb48ac8e on Jun 30, 2026BigcoinBGC referenced this in commit 7211f3fe3b on Jun 30, 2026bitcoin locked this on Jul 30, 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-08-11 11:51 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me