HasWallets()
is used only once and at the call site there’s already a way to know if any wallet is loaded.
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-
promag commented at 9:35 pm on June 12, 2020: memberMinor follow-up of #19250. The global
-
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()) {
MarcoFalke approvedMarcoFalke commented at 9:52 pm on June 12, 2020: memberACKDrahtBot added the label Refactoring on Jun 12, 2020DrahtBot added the label RPC/REST/ZMQ on Jun 12, 2020DrahtBot added the label Wallet on Jun 12, 2020refactor: Drop ::HasWallets() ccf1f6ea24promag force-pushed on Jun 13, 2020in 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 lockcs_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.MarcoFalke commented at 11:34 am on June 13, 2020: memberACK ccf1f6ea24905876f35e685204cb2293cf083e97MarcoFalke closed this on Jun 13, 2020
MarcoFalke reopened this on Jun 13, 2020
MarcoFalke removed the label RPC/REST/ZMQ on Jun 13, 2020MarcoFalke removed the label Wallet on Jun 13, 2020hebasto approvedhebasto commented at 1:26 pm on June 13, 2020: memberACK ccf1f6ea24905876f35e685204cb2293cf083e97, I have reviewed the changes and they look OK, I agree they can be merged.MarcoFalke merged this on Jun 13, 2020MarcoFalke closed this on Jun 13, 2020
sidhujag referenced this in commit f308262ced on Jun 14, 2020Fabcien referenced this in commit d66b0479d4 on Apr 29, 2021DrahtBot locked this on Feb 15, 2022Labels
Refactoring
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-11-17 06:12 UTC
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-11-17 06:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me