diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-05-22 16:18:07 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-05-22 16:56:20 +0100 |
commit | 80b4910f7d87983f50047074c3c2397b0a5c4e92 (patch) | |
tree | 0bd471d1bc9b659b52033bd333cfe9b433e9b4e1 /src/interfaces/node.cpp | |
parent | 6916024768ec57a00f54224640ab4e4871d2a30a (diff) |
wallet: Use shared pointer to retain wallet instance
Diffstat (limited to 'src/interfaces/node.cpp')
-rw-r--r-- | src/interfaces/node.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index 73657d4f5a..9270351176 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -222,8 +222,8 @@ class NodeImpl : public Node { #ifdef ENABLE_WALLET std::vector<std::unique_ptr<Wallet>> wallets; - for (CWallet* wallet : GetWallets()) { - wallets.emplace_back(MakeWallet(*wallet)); + for (const std::shared_ptr<CWallet>& wallet : GetWallets()) { + wallets.emplace_back(MakeWallet(wallet)); } return wallets; #else @@ -249,7 +249,7 @@ class NodeImpl : public Node std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override { CHECK_WALLET( - return MakeHandler(::uiInterface.LoadWallet.connect([fn](CWallet* wallet) { fn(MakeWallet(*wallet)); }))); + return MakeHandler(::uiInterface.LoadWallet.connect([fn](std::shared_ptr<CWallet> wallet) { fn(MakeWallet(wallet)); }))); } std::unique_ptr<Handler> handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) override { |