refactor: Drop ::HasWallets() #19261

pull promag wants to merge 1 commits into bitcoin:master from promag:2020-06-drop-has-wallets changing 3 files +1 −8
  1. promag commented at 9:35 pm on June 12, 2020: member
    Minor follow-up of #19250. The global HasWallets() is used only once and at the call site there’s already a way to know if any wallet is loaded.
  2. in src/wallet/rpcwallet.cpp:109 in d85c6da5d2 outdated
    105@@ -106,7 +106,7 @@ std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& reques
    106         return wallets[0];
    107     }
    108 
    109-    if (!HasWallets()) {
    110+    if (wallets.size() == 0) {
    


    MarcoFalke commented at 9:52 pm on June 12, 2020:
    0    if (wallets.empty()) {
    
  3. MarcoFalke approved
  4. MarcoFalke commented at 9:52 pm on June 12, 2020: member
    ACK
  5. DrahtBot added the label Refactoring on Jun 12, 2020
  6. DrahtBot added the label RPC/REST/ZMQ on Jun 12, 2020
  7. DrahtBot added the label Wallet on Jun 12, 2020
  8. refactor: Drop ::HasWallets() ccf1f6ea24
  9. promag force-pushed on Jun 13, 2020
  10. in src/wallet/rpcwallet.cpp:109 in ccf1f6ea24
    105@@ -106,7 +106,7 @@ std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& reques
    106         return wallets[0];
    107     }
    108 
    109-    if (!HasWallets()) {
    110+    if (wallets.empty()) {
    


    hebasto commented at 4:59 am on June 13, 2020:
    Why it is safe do not lock cs_wallets now?

    MarcoFalke commented at 11:32 am on June 13, 2020:
    I presume for the same reason that it is safe to return wallets[0] without the lock. cs_wallets only protects vpwallets, not copies of the shared pointers.
  11. MarcoFalke commented at 11:34 am on June 13, 2020: member
    ACK ccf1f6ea24905876f35e685204cb2293cf083e97
  12. MarcoFalke closed this on Jun 13, 2020

  13. MarcoFalke reopened this on Jun 13, 2020

  14. MarcoFalke removed the label RPC/REST/ZMQ on Jun 13, 2020
  15. MarcoFalke removed the label Wallet on Jun 13, 2020
  16. hebasto approved
  17. hebasto commented at 1:26 pm on June 13, 2020: member
    ACK ccf1f6ea24905876f35e685204cb2293cf083e97, I have reviewed the changes and they look OK, I agree they can be merged.
  18. MarcoFalke merged this on Jun 13, 2020
  19. MarcoFalke closed this on Jun 13, 2020

  20. sidhujag referenced this in commit f308262ced on Jun 14, 2020
  21. Fabcien referenced this in commit d66b0479d4 on Apr 29, 2021
  22. DrahtBot locked this on Feb 15, 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: 2024-12-18 18:12 UTC

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