getnewaddress gives out used address #10411

issue ghost opened this issue on May 16, 2017
  1. ghost commented at 7:34 PM on May 16, 2017: none

    Describe the issue

    I have 2 chains with identical copies of the wallet.dat. The keypool has 10000 addresses of which a tiny fraction has received bitcoin. So far, I've only used it to receive bitcoin.

    The rpc command 'getnewaddress' gives out addresses that have already received bitcoin. I would think the bitcoin client, no matter what machine it runs from looks at what addresses have received bitcoin and then give out a clean unused address.

    I've performed a start up with -rescan, but same result.

    Can you reliably reproduce the issue?

    Yes

    Expected behaviour

    Tell us what should happen

    receive an unused address, no matter which one of identical wallet.dat files are used.

    Actual behaviour

    Tell us what happens instead

    See above.

    What version of bitcoin-core are you using?

    List the version number/commit ID, and if it is an official binary, self compiled or a distribution package such as PPA.

    0.14.1 32 bit from bitcoin.org, not self compiled.

    Machine specs:

    • OS: Ubuntu 14.1
    • CPU: Intel duo
    • RAM: 1 G
    • Disk size: 200 Gb
    • Disk Type (HD/SDD): HD

    Any extra information that might be useful in the debugging process.

    This is normally the contents of a debug.log or config.log file. Raw text or a link to a pastebin type site are preferred.

    debug.log:

    keypool reserve 33 keypool keep 33

  2. fanquake added the label RPC/REST/ZMQ on May 17, 2017
  3. laanwj commented at 7:10 AM on May 17, 2017: member

    Using the same wallet on multiple nodes is not a supported scenario at the moment. This is expected behavior. There is some work in progress to automatically roll forward the HD chain when keys in the keypool are seen to be used, which might help here, but I'd still not recommend to do this.

  4. laanwj added the label Wallet on May 17, 2017
  5. MarcoFalke commented at 12:55 AM on April 26, 2020: member

    I think -rescan will forward the HD chain/keypool appropriately if a tx was found in the chain. If it was never used on-chain, but given out, the only thing that can be done is to manually call getnewaddress in a loop to "discard" used addresses.

  6. MarcoFalke closed this on Apr 26, 2020

  7. DrahtBot locked this on Feb 15, 2022

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-13 15:15 UTC

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