getnewaddress always returns same type #16178

issue pfergi42 opened this issue on June 9, 2019
  1. pfergi42 commented at 11:09 PM on June 9, 2019: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    <!--- What behavior did you expect? -->

    When I run "getnewaddress legacy" I expect to get an address starting with a "1". When I run "getnewaddress p2sh-segwit" I expect to get an address starting with a "3". When I run "getnewaddress bech32" I expect to get an address starting with "bc1".

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    I always get an address starting a "3". Another user I know always gets an address starting with a "1".

    getnewaddress-screenshot

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    This is reproducible both from command line running bitcoind, and also bitcoin-Qt. From bitcoind, I type:

    bitcoin-cli getnewaddress legacy

    Or from bitcoin-Qt I issue the commands from the debug window console, as shown in the screenshot above.

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    Running version 0.18 downloaded from https://bitcoin.org/en/download

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    I'm running on macOS Mojave Version 10.14.5, and I always get an address starting with "3". The other user I know runs Ubuntu, and always gets an address starting with a "1".

    <!-- For the GUI-related issue on Linux provide names and versions of a distro, a desktop environment and a graphical shell (if relevant). -->

    N//a

    <!-- 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. -->

  2. achow101 commented at 11:21 PM on June 9, 2019: member

    Your are missing the label argument that goes between the command name and the type parameter. Bitcoin Core is interpreting your type parameter as the label name. Instead try getnewaddress "" legacy

  3. pfergi42 commented at 11:26 PM on June 9, 2019: none

    @achow101 That worked! Thank you so much!

    empty_string

  4. pfergi42 closed this on Jun 10, 2019

  5. pfergi42 commented at 4:14 PM on March 19, 2020: none

    Actually this problem is still not resolved. It could be something to do with the config file. If anyone else has this issue please comment.

  6. pfergi42 reopened this on Mar 19, 2020

  7. sipa commented at 4:17 PM on March 19, 2020: member

    Can you explain how it is not resolved? Everything looks correct in the screenshot above.

  8. pfergi42 commented at 5:33 PM on March 19, 2020: none

    The screenshot I originally posted was from my tests on another box on a OSX. The problem we are still experiencing is on a Linux machine.

    I've posted a more clear description of the problem as it appears on the Linux machine here: https://bitcoin.stackexchange.com/questions/93868/getnewaddress-wont-generate-bech32-or-p2sh-segwit-addresses

  9. pfergi42 commented at 6:23 PM on March 19, 2020: none

    Thanks to @sipa we resolved this issue by upgrading our wallet.dat and then running getnewaddress a bunch of times. Issue resolved.

  10. pfergi42 closed this on Mar 19, 2020

  11. MarcoFalke added the label Questions and Help on Jul 4, 2020
  12. MarcoFalke added the label Wallet on Jul 4, 2020
  13. 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-21 15:14 UTC

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