Coin Control doesn't recognize my segwit address as a valid change address #11137

issue grant-olson opened this issue on August 25, 2017
  1. grant-olson commented at 4:16 PM on August 25, 2017: none

    Describe the issue

    1. Open wallet on testnet.
    2. Create an address.
    3. run addwitnessaddress with new address.
    4. Send money with coin control enabled:
      • Check 'Custom Change Address'
      • Specify segwit address

    Expected behaviour

    Should work just fine.

    Actual behaviour

    1. Get a warning saying I don't control this address, and presumably won't actually get the change.

    2. I do get the change.

    Screenshots.

    If the issue is related to the GUI, screenshots can be added to this issue via drag & drop.

    What version of bitcoin-core are you using?

    0.14.2

    screen shot 2017-08-25 at 12 15 35 pm

  2. grant-olson commented at 4:46 PM on August 25, 2017: none

    Confirmed issue is still there in 0.15.0-rc2.

  3. dooglus commented at 10:33 PM on August 28, 2017: contributor

    The same happens if you try to send change to any multisig address, even if you own all the keys.

    The code is checking for the existence of a private key for the address directly: wallet->HaveKey(address) rather than using IsMine() which is more sophisticated, and knows about SegWit, multisig, etc.

  4. dooglus commented at 10:52 PM on August 28, 2017: contributor

    commit ffe14720573f2d99e808c13cfdab5899c24ec8bf seems to fix the problem. havePrivKey() is only used in this one place, and it's the wrong function to use.

  5. dooglus cross-referenced this on Aug 28, 2017 from issue Use IsMine to validate custom change address by dooglus
  6. laanwj referenced this in commit a6c439f694 on Sep 5, 2017
  7. MarcoFalke cross-referenced this on Sep 5, 2017 from issue qt: Use IsMine to validate custom change address by MarcoFalke
  8. MarcoFalke closed this on Sep 5, 2017

  9. MarcoFalke referenced this in commit a31e9ad4f0 on Sep 5, 2017
  10. PastaPastaPasta referenced this in commit baecc42630 on Sep 20, 2019
  11. PastaPastaPasta referenced this in commit 175a137809 on Sep 20, 2019
  12. PastaPastaPasta referenced this in commit 28b75689d9 on Sep 23, 2019
  13. PastaPastaPasta referenced this in commit b2c4b988a6 on Sep 23, 2019
  14. PastaPastaPasta referenced this in commit 7168a69cbc on Sep 24, 2019
  15. codablock referenced this in commit a88e000fe9 on Sep 25, 2019
  16. barrystyle referenced this in commit bbb6ea6af3 on Jan 22, 2020
  17. bitcoin 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-05-20 06:55 UTC