addwitnessaddress fails with v0.15.0rc2 #11146

issue clemtaylor opened this issue on August 25, 2017
  1. clemtaylor commented at 9:09 PM on August 25, 2017: contributor

    On the console I do:

    getnewaddress
    <address 1...>
    addwitnessaddress <addr-from-getnewaddress>
    Public key or redeemscript not known to wallet, or the key is uncompressed (code -4)
    

    I expected this to produce a segwit witness address, I saw examples of other people doing the same thing with v0.15.x and it worked.

    I'm using a wallet from 2011, but I recently flushed out the keypool, so all the keys should have been generated with 0.14.2.

    Using client compiled from v0.15.0rc2 git tag on x86_64 linux (fedora 26)

  2. sipa commented at 9:10 PM on August 25, 2017: member

    Your old wallet may be using uncompressed keys if you never upgraded it using -upgradewallet. Such keys cannot be used in SegWit.

  3. clemtaylor commented at 11:06 PM on August 25, 2017: contributor

    Okay, I used -upgradewallet (saw "Performing wallet upgrade to 60000" in the log).

    I repeated the above test got the same error.

    So now I have to call getnewaddress 1000 times to find an compressed key I can use with segwit? Ouch.

    I guess it is time to dump my wallet, filter out all the unused keys and import the used keys into a new wallet.

  4. fanquake added the label RPC/REST/ZMQ on Aug 26, 2017
  5. achow101 commented at 4:11 AM on August 26, 2017: member

    Changing your password would also make an entirely new keypool which would have uncompressed keys. So I think if you changed your password (or set one), you would get new addresses for which you could use addwitnessaddress with.

  6. clemtaylor closed this on Aug 29, 2017

  7. MarcoFalke locked this on Sep 8, 2021

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