refactor: Drop redundant wallet reference #15458

pull promag wants to merge 1 commits into bitcoin:master from promag:2019-02-interfaces-wallet changing 1 files +127 −128
  1. promag commented at 3:28 pm on February 21, 2019: member

    Removes the redudant wallet reference from WalletImpl.

    0// before:
    1std::shared_ptr<CWallet> m_shared_wallet;
    2CWallet& m_wallet;
    3
    4// after
    5std::shared_ptr<CWallet> m_wallet;
    
  2. promag commented at 3:29 pm on February 21, 2019: member
    Suggested by @ryanofsky in #15195 (comment).
  3. in src/interfaces/wallet.cpp:162 in 526c5670d6 outdated
    172-    bool getPrivKey(const CKeyID& address, CKey& key) override { return m_wallet.GetKey(address, key); }
    173-    bool isSpendable(const CTxDestination& dest) override { return IsMine(m_wallet, dest) & ISMINE_SPENDABLE; }
    174-    bool haveWatchOnly() override { return m_wallet.HaveWatchOnly(); };
    175+    bool getPubKey(const CKeyID& address, CPubKey& pub_key) override { return m_wallet->GetPubKey(address, pub_key); }
    176+    bool getPrivKey(const CKeyID& address, CKey& key) override { return m_wallet->GetKey(address, key); }
    177+    bool isSpendable(const CTxDestination& dest) override { return IsMine(*m_wallet.get(), dest) & ISMINE_SPENDABLE; }
    


    ryanofsky commented at 3:49 pm on February 21, 2019:
    Here and other places, this should change to *m_wallet instead of *m_wallet.get(). It’s shorter, more readable, and potentially allows better error checking since the overloaded method can detect a null dereference.

    promag commented at 4:04 pm on February 21, 2019:
    Oh I forgot about that operator, thanks.
  4. ryanofsky approved
  5. ryanofsky commented at 3:54 pm on February 21, 2019: member
    utACK 526c5670d6fd866dfa0fb17ff40356d6fd089262
  6. refactor: Drop redundant wallet reference 53b310390c
  7. promag force-pushed on Feb 21, 2019
  8. ryanofsky approved
  9. ryanofsky commented at 4:44 pm on February 21, 2019: member
    utACK 53b310390cc72a034911a8d6236b472a22c62227
  10. DrahtBot commented at 4:52 pm on February 21, 2019: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15288 (Remove wallet -> node global function calls by ryanofsky)
    • #12096 ([rpc] [wallet] Allow specifying the output index when using bumpfee by kallewoof)

    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.

  11. laanwj added the label Refactoring on Feb 21, 2019
  12. laanwj commented at 6:49 pm on February 21, 2019: member
    utACK 53b310390cc72a034911a8d6236b472a22c62227
  13. jonasschnelli commented at 6:42 am on February 22, 2019: contributor
    utACK 53b310390cc72a034911a8d6236b472a22c62227
  14. MarcoFalke merged this on Feb 22, 2019
  15. MarcoFalke closed this on Feb 22, 2019

  16. MarcoFalke referenced this in commit 77fcf252f6 on Feb 22, 2019
  17. promag deleted the branch on Feb 22, 2019
  18. deadalnix referenced this in commit 02766ca19f on May 29, 2020
  19. Munkybooty referenced this in commit 331009d76b on Sep 7, 2021
  20. Munkybooty referenced this in commit 53f3568f66 on Sep 7, 2021
  21. ogabrielides referenced this in commit fa4e5c0f86 on Sep 13, 2021
  22. ogabrielides referenced this in commit 0649257321 on Sep 15, 2021
  23. ogabrielides referenced this in commit e7426ae980 on Sep 16, 2021
  24. PastaPastaPasta referenced this in commit 0fc4d55c1c on Sep 16, 2021
  25. 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: 2024-12-18 15:12 UTC

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