Issue Details

Number
29924
Title
`keypoolrefill` doesn't fill keypool to specified parameter
Description
### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behaviour According to the help manual the parameter is `newsize` and `keypoolrefill` fills the keypool to `newsize`. This was the behavior up to at least v21 of bitcoind. In v24 of bitcoind these semantics have changed. Related to https://github.com/bitcoin-s/bitcoin-s/pull/5496 ``` $ bitcoin-cli -regtest getwalletinfo { "walletname": "", "walletversion": 169900, "format": "sqlite", "balance": 50.00000000, "unconfirmed_balance": 0.00000000, "immature_balance": 3675.00000000, "txcount": 101, "keypoolsize": 4000, "keypoolsize_hd_internal": 4000, "paytxfee": 0.00000000, "private_keys_enabled": true, "avoid_reuse": false, "scanning": false, "descriptors": true, "external_signer": false } ``` So I have a keypool of size `4,000` ``` $ bitcoin-cli -regtest keypoolrefill 4001 ``` Somehow I end up with a keypool size of 16,004? ``` $ bitcoin-cli -regtest getwalletinfo { "walletname": "", "walletversion": 169900, "format": "sqlite", "balance": 50.00000000, "unconfirmed_balance": 0.00000000, "immature_balance": 3675.00000000, "txcount": 101, "keypoolsize": 16004, "keypoolsize_hd_internal": 16004, "paytxfee": 0.00000000, "private_keys_enabled": true, "avoid_reuse": false, "scanning": false, "descriptors": true, "external_signer": false } ``` ### Expected behaviour I would expect `keypoolrefill` to fill up the keypool to the given parameter. ### Steps to reproduce Run commands given in the issue ### Relevant log output _No response_ ### How did you obtain Bitcoin Core Pre-built binaries ### What version of Bitcoin Core are you using? Bitcoin Core version v24.2.0 ### Operating system and version Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 arm64 ### Machine specifications _No response_
URL
https://github.com/bitcoin/bitcoin/issue/29924
Closed by
Back to List