Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keypoolrefill doesn't fill keypool to specified parameter #29924

Open
1 task done
Christewart opened this issue Apr 20, 2024 · 1 comment
Open
1 task done

keypoolrefill doesn't fill keypool to specified parameter #29924

Christewart opened this issue Apr 20, 2024 · 1 comment
Labels

Comments

@Christewart
Copy link
Contributor

Christewart commented Apr 20, 2024

Is there an existing issue for this?

  • 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 bitcoin-s/bitcoin-s#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

Christewart added a commit to Christewart/bitcoin-s-core that referenced this issue Apr 20, 2024
Christewart added a commit to bitcoin-s/bitcoin-s that referenced this issue Apr 20, 2024
* Remove support for v21 of bitcoind

* WIP: Remove deprecated rpcs wit legacy wallets

* WIP: Work up to importdescriptor

* Get low-r test case passing

* Simplify test case

* Remove BitcoindV21RpcClientTest and move test cases to BitcoindV24RpcClientTest

* Remove RpcTransactionRpcTest that only works on legacy wallet

* Fix MempoolRpcTest

* Delete MultisigRpcTest that depends on legacy wallet

* Get WalletRpcTest passing, ignore keypoolrefill test case for now until bitcoin/bitcoin#29924 is resolved
@laanwj laanwj added the Wallet label Apr 22, 2024
@brunoerg
Copy link
Contributor

brunoerg commented May 7, 2024

I think you have more than one ScriptPubKeyManager. When you call keypoolrefill it will top up every spkm. Did you check listdescriptors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@laanwj @Christewart @brunoerg and others