[Qt] Check return value of addr.GetKeyID(keyid) on custom change address change #10972

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:GetKeyID-assertion changing 1 files +2 −2
  1. practicalswift commented at 9:37 PM on August 1, 2017: contributor

    Check return value of addr.GetKeyID(keyid) on custom change address change. Prior to this commit this was the only place where the return value of GetKeyID(…) was unchecked.

    Clarify our assumption of addr.GetKeyID(keyid) being true in this context via an assertion.

    (Note to reviewers: Let me know if this assumption is not being made. If the assumption is not made then the case of !addr.GetKeyID(keyid) should obviously be handled more gracefully than with an assert :-))

  2. practicalswift renamed this:
    Check return value of addr.GetKeyID(keyid) on custom change address change
    [Qt] Check return value of addr.GetKeyID(keyid) on custom change address change
    on Aug 1, 2017
  3. promag commented at 11:08 PM on August 1, 2017: member

    utACK 65bb605.

  4. jonasschnelli commented at 9:44 AM on August 3, 2017: contributor

    utACK 65bb605b71f0494d23d61f545f7638df60b23e10

  5. jonasschnelli added the label GUI on Aug 3, 2017
  6. gmaxwell commented at 8:16 AM on August 4, 2017: contributor

    This looks like it will be an instant crash if you put a P2SH address in the field.

  7. [Qt] Check return value of addr.GetKeyID(keyid) on custom change address change 37c4144e1c
  8. practicalswift force-pushed on Aug 4, 2017
  9. practicalswift commented at 8:30 AM on August 4, 2017: contributor

    @gmaxwell Thanks for reviewing and clarifying that the old code does not assume addr.GetKeyID(keyid) being true.

    I've now changed to if (!valid || !model->havePrivKey(keyid)) { … } for the unknown change address code path - looks good? :-)

  10. gmaxwell commented at 8:41 AM on August 4, 2017: contributor

    I think the code there just doesn't correctly handle p2sh keys in general. Probably needs a more extensive fixup than that, though the assert seems clearly not right. :)

  11. TheBlueMatt commented at 9:43 PM on September 4, 2017: member

    Likely not neccessary if #11184 lands.

  12. practicalswift commented at 9:51 PM on September 4, 2017: contributor

    @TheBlueMatt Thanks for the notification! @dooglus PR is the better choice. Closing this PR! :-)

  13. practicalswift closed this on Sep 4, 2017

  14. practicalswift deleted the branch on Apr 10, 2021
  15. DrahtBot locked this on Aug 18, 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-14 21:15 UTC

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