Move ismine to the wallet module #16226

pull achow101 wants to merge 2 commits into bitcoin:master from achow101:mv-ismine-wallet changing 14 files +425 −385
  1. achow101 commented at 6:48 PM on June 17, 2019: member

    IsMine isn't used outside of the wallet except for the tests. It also doesn't make sense to be outside of the wallet. This PR moves IsMine into the wallet module and for it to take a CWallet instead of CKeyStore. The test that used IsMine is also moved to the wallet tests.

    This is first prerequisites for the wallet structure changes.

  2. MarcoFalke commented at 7:04 PM on June 17, 2019: member

    Concept ACK. I think you'd need to update the linter after the rename to CWallet?

  3. achow101 force-pushed on Jun 17, 2019
  4. achow101 commented at 7:29 PM on June 17, 2019: member

    Added the circular dependency to the linter. It should be removed in the future once ScriptPubKeyManager is introduced.

  5. achow101 force-pushed on Jun 17, 2019
  6. achow101 force-pushed on Jun 17, 2019
  7. achow101 force-pushed on Jun 17, 2019
  8. meshcollider added the label Refactoring on Jun 17, 2019
  9. meshcollider added the label Wallet on Jun 17, 2019
  10. meshcollider commented at 8:25 PM on June 17, 2019: contributor

    Approach ACK, I'm ok with adding the circular dependency temporarily to be removed in a future PR as discussed with you at coredev

  11. practicalswift commented at 8:30 PM on June 17, 2019: contributor

    Concept ACK

  12. MarcoFalke commented at 9:35 PM on June 17, 2019: member

    ACK 3d77d8f48cc494fe5f272c175663b554e8aa6e3a (checked move-only and CWallet rename)

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK 3d77d8f48cc494fe5f272c175663b554e8aa6e3a (checked move-only and CWallet rename)
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUikRQwAs9jDnCyIA93DlExBgTpbLV4DtTLKwfchRLURdMwt9/RFGjJAF9SDwwj1
    gQC7eSmJYIrBff4Lx6BcYu/7vbqrSsxVmmHMQZJGZ8iv2hIjUg+YBwV6xgItRLbJ
    hab8JXQ6a9QREK1beMlnvuWviIFX2EwEgk/dihByTIl7BLGL40x9t0XHuDWwdYz2
    4VNsAYI6CO4oo0MztvpMKWPJutNeZpHJz6dBCj+ZB+Ra46yTZP6+HBLVHesZuomE
    jjBWLfIHbv0/U8AkdhJCb+Y7uAKR9NNn6j2fGhuNqno/PhrFV4/oT9wa5XU7yLOP
    Ze+0CYJa/j3oemkmWrYwWQRZyUcfdgK3h0nEMhWN36TpUalcbdR8+lynmxi5p82m
    4YvlhiN9B2Hby4gXnVqnuNFqpi3HUfsexM0bxEJaoqg/Vn7A8lcnaf47e8WC5RYl
    k9AeC/VV8qC6g6hYO+l4nLPs+nhkJtcdYFfwX+JxLs/wn/RJMFmvEMzdj6YloKx0
    BLikxgFs
    =j1at
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash 8f465f280a7c3d1fd7c5da64fad29ace14155377e17cdb1af8661e6bfe1a967a -

    </details>

  13. in src/interfaces/wallet.h:29 in 3d77d8f48c outdated
      23 | @@ -25,7 +24,10 @@ class CCoinControl;
      24 |  class CFeeRate;
      25 |  class CKey;
      26 |  class CWallet;
      27 | +enum isminetype : unsigned int;
      28 |  enum class FeeReason;
      29 | +typedef uint8_t isminefilter;
    


    Empact commented at 9:57 PM on June 17, 2019:

    nit: using?


    MarcoFalke commented at 9:59 PM on June 17, 2019:

    Yeah, but should change it in the original header file as well.

  14. Empact commented at 9:59 PM on June 17, 2019: member

    Concept ACK maybe keep CKeystore to avoid circular dependency?

  15. achow101 commented at 10:13 PM on June 17, 2019: member

    maybe keep CKeystore to avoid circular dependency?

    In this whole wallet restructure, I don't think there's any way around a circular dependency here temporarily. IMO it makes more sense to do the change here rather than in another PR.

  16. DrahtBot commented at 10:42 PM on June 17, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #14384 (Resolve validationinterface circular dependencies by l2a5b1)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  17. fanquake requested review from sipa on Jun 18, 2019
  18. ryanofsky commented at 8:54 PM on June 18, 2019: member

    utACK 3d77d8f48cc494fe5f272c175663b554e8aa6e3a. Easy review with --color-moved=dimmed_zebra.

    It'd be nice to add a project to link the various issues and prs together (#16226, #16227, #15764, #16165)

  19. ryanofsky approved
  20. MarcoFalke commented at 9:01 PM on June 18, 2019: member

    This will be merged next week, unless there are objections.

  21. MarcoFalke closed this on Jun 18, 2019

  22. MarcoFalke reopened this on Jun 18, 2019

  23. promag commented at 9:45 PM on June 18, 2019: member

    ACK 3d77d8f48cc494fe5f272c175663b554e8aa6e3a.

  24. sipa approved
  25. sipa commented at 9:50 PM on June 18, 2019: member

    Concept and superficial code review ACK 3d77d8f48cc494fe5f272c175663b554e8aa6e3a. I haven't verified move-only-ness.

    Circular dependencies are expected while things are being moved around.

  26. DrahtBot added the label Needs rebase on Jun 18, 2019
  27. jnewbery commented at 8:23 PM on June 19, 2019: member

    Concept ACK

  28. jnewbery added this to the "PRs" column in a project

  29. Move ismine to wallet module 7c611e2000
  30. Change ismine to take a CWallet instead of CKeyStore e61de6306f
  31. achow101 force-pushed on Jun 19, 2019
  32. achow101 commented at 10:07 PM on June 19, 2019: member

    Rebased

  33. DrahtBot removed the label Needs rebase on Jun 19, 2019
  34. MarcoFalke commented at 11:54 AM on June 20, 2019: member

    re-ACK e61de6306f (only change is rebase with git auto-merge)

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    re-ACK e61de6306f (only change is rebase with git auto-merge)
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUhq9QwAycC7mPLbHS+867UvtogkH0L4oG05HtDBKb0kCQ2e/CeLV2PaJB0s1cgo
    hsZKIKtGErRyY1AnFq30VdkVweUD8UkICSb9q2zqPWYOXmG87hM4kOoySXlUCp/i
    VaDPpd/nG1evVqkrfe3Q1WeQzgELJaf5zNghka1rcuJH/SMGVKTLY8zR/9KvG7n2
    CQxyX6QbU6bddDqO3AfnE2+hDs5OpfPI3DXouz+pd17qLzH0wpksI+6CcnzI9w2J
    x8jlQwZO8HB0FV0FB2N0rS3kqgfON9At3P++sGfdxxbfjZgyfxKtjKs54RHwSix5
    UQ/P4c25iRqNlG3DI7+icZ1zp/JRNlZ5v20a/pIG/r/ZD6jBKn/MvY2aPZve9X8b
    zfwvYMivFY7D8bHLWZ+3AqrDwZN/jDTuRhXAuXPzPxtWD6sTimAb95Yt/jqI67Pr
    9ri/xaDHugu2Ay7wJM36MqSd9kV6cppXQXaeRKbaPHtO2QAAQApo/hlx4Kr6YJ1y
    c0iF595K
    =Cy/u
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash 422247e430c86078dea26fdbc2e84832a7979645f33ca2b8bd2dd37469561631 -

    </details>

  35. meshcollider commented at 7:57 AM on June 21, 2019: contributor
  36. meshcollider merged this on Jun 21, 2019
  37. meshcollider closed this on Jun 21, 2019

  38. meshcollider referenced this in commit fd333e15a5 on Jun 21, 2019
  39. laanwj commented at 10:29 AM on June 21, 2019: member

    posthumous ACK e61de6306fd89fe9aae90253062e7b1b20343f8a, agree it belongs with the wallet and that this is a better grouping than 'script', which is not a very useful axis to split (consensus/policy/wallet is better).

  40. in src/wallet/ismine.h:31 in e61de6306f
      27 | @@ -28,8 +28,8 @@ enum isminetype
      28 |  /** used for bitflags of isminetype */
      29 |  typedef uint8_t isminefilter;
      30 |  
      31 | -isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
      32 | -isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest);
      33 | +isminetype IsMine(const CWallet& wallet, const CScript& scriptPubKey);
    


    jnewbery commented at 4:17 PM on June 21, 2019:

    It's a shame that the declaration and definition have different argument names (wallet here in the decl and keystore in the def)

  41. in src/wallet/test/ismine_tests.cpp:37 in e61de6306f
      32 | +    CScript scriptPubKey;
      33 | +    isminetype result;
      34 | +
      35 | +    // P2PK compressed
      36 | +    {
      37 | +        CWallet keystore(chain.get(), WalletLocation(), WalletDatabase::CreateDummy());
    


    jnewbery commented at 4:18 PM on June 21, 2019:

    I'd prefer all these variables are named wallet instead of keystore, since that's what they are!

  42. jnewbery commented at 4:19 PM on June 21, 2019: member

    post-merge ACK e61de6306fd89fe9aae90253062e7b1b20343f8a

    I think the naming in variables/defns should be updated to be accurate. @achow101 - would it interfere with your further refactors if I opened a PR to do that?

  43. jnewbery moved this from the "PRs" to the "Done" column in a project

  44. sidhujag referenced this in commit 2d78c8abe9 on Jun 21, 2019
  45. deadalnix referenced this in commit 45be61fdcb on Jun 6, 2020
  46. deadalnix referenced this in commit 168db81b1d on Jun 6, 2020
  47. vijaydasmp referenced this in commit 3c5fdcb567 on Oct 20, 2021
  48. vijaydasmp referenced this in commit fe9f805754 on Oct 20, 2021
  49. vijaydasmp referenced this in commit f97858d3f7 on Oct 21, 2021
  50. vijaydasmp referenced this in commit 3eb87e7ed7 on Oct 21, 2021
  51. vijaydasmp referenced this in commit 16230016d5 on Oct 23, 2021
  52. vijaydasmp referenced this in commit 363233339b on Oct 26, 2021
  53. vijaydasmp referenced this in commit 5dcb4987d2 on Nov 5, 2021
  54. vijaydasmp referenced this in commit 4d048f3aaa on Dec 6, 2021
  55. vijaydasmp referenced this in commit 9892f76143 on Dec 10, 2021
  56. vijaydasmp referenced this in commit c49c2a4547 on Dec 10, 2021
  57. vijaydasmp referenced this in commit 51f6755f8d on Dec 10, 2021
  58. vijaydasmp referenced this in commit 0ee00c3126 on Dec 11, 2021
  59. vijaydasmp referenced this in commit eb0a1f14f4 on Dec 11, 2021
  60. vijaydasmp referenced this in commit 91a576717f on Dec 11, 2021
  61. vijaydasmp referenced this in commit 3741dd93cf on Dec 11, 2021
  62. vijaydasmp referenced this in commit e30ebc1369 on Dec 13, 2021
  63. vijaydasmp referenced this in commit abe0e646ea on Dec 13, 2021
  64. vijaydasmp referenced this in commit 148dc53e51 on Dec 13, 2021
  65. vijaydasmp referenced this in commit 93754b3d73 on Dec 14, 2021
  66. vijaydasmp referenced this in commit 4f2972575d on Dec 14, 2021
  67. vijaydasmp referenced this in commit 6c33e20e8a on Dec 15, 2021
  68. vijaydasmp referenced this in commit 307eab80d4 on Dec 15, 2021
  69. vijaydasmp referenced this in commit ea1407b441 on Dec 15, 2021
  70. DrahtBot locked this on Dec 16, 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-19 00:14 UTC

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