mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
wallet: Use shared pointer to retain wallet instance
This commit is contained in:
parent
6916024768
commit
80b4910f7d
15 changed files with 239 additions and 139 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue