Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.cpp
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | class NodeImpl : public Node { | ||||
} | } | ||||
bool getUnspentOutput(const COutPoint &output, Coin &coin) override { | bool getUnspentOutput(const COutPoint &output, Coin &coin) override { | ||||
LOCK(::cs_main); | LOCK(::cs_main); | ||||
return ::pcoinsTip->GetCoin(output, coin); | return ::pcoinsTip->GetCoin(output, coin); | ||||
} | } | ||||
std::vector<std::unique_ptr<Wallet>> getWallets() override { | std::vector<std::unique_ptr<Wallet>> getWallets() override { | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
std::vector<std::unique_ptr<Wallet>> wallets; | std::vector<std::unique_ptr<Wallet>> wallets; | ||||
for (CWallet *wallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &wallet : GetWallets()) { | ||||
wallets.emplace_back(MakeWallet(*wallet)); | wallets.emplace_back(MakeWallet(wallet)); | ||||
} | } | ||||
return wallets; | return wallets; | ||||
#else | #else | ||||
throw std::logic_error( | throw std::logic_error( | ||||
"Node::getWallets() called in non-wallet build."); | "Node::getWallets() called in non-wallet build."); | ||||
#endif | #endif | ||||
} | } | ||||
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override { | std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override { | ||||
return MakeHandler(::uiInterface.InitMessage.connect(fn)); | return MakeHandler(::uiInterface.InitMessage.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override { | std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override { | ||||
return MakeHandler(::uiInterface.ThreadSafeMessageBox.connect(fn)); | return MakeHandler(::uiInterface.ThreadSafeMessageBox.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override { | std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override { | ||||
return MakeHandler(::uiInterface.ThreadSafeQuestion.connect(fn)); | return MakeHandler(::uiInterface.ThreadSafeQuestion.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> | std::unique_ptr<Handler> | ||||
handleShowProgress(ShowProgressFn fn) override { | handleShowProgress(ShowProgressFn fn) override { | ||||
return MakeHandler(::uiInterface.ShowProgress.connect(fn)); | return MakeHandler(::uiInterface.ShowProgress.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override { | std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override { | ||||
CHECK_WALLET(return MakeHandler(::uiInterface.LoadWallet.connect( | CHECK_WALLET(return MakeHandler(::uiInterface.LoadWallet.connect( | ||||
[fn](CWallet *wallet) { fn(MakeWallet(*wallet)); }))); | [fn](std::shared_ptr<CWallet> wallet) { | ||||
fn(MakeWallet(wallet)); | |||||
}))); | |||||
} | } | ||||
std::unique_ptr<Handler> handleNotifyNumConnectionsChanged( | std::unique_ptr<Handler> handleNotifyNumConnectionsChanged( | ||||
NotifyNumConnectionsChangedFn fn) override { | NotifyNumConnectionsChangedFn fn) override { | ||||
return MakeHandler( | return MakeHandler( | ||||
::uiInterface.NotifyNumConnectionsChanged.connect(fn)); | ::uiInterface.NotifyNumConnectionsChanged.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleNotifyNetworkActiveChanged( | std::unique_ptr<Handler> handleNotifyNetworkActiveChanged( | ||||
NotifyNetworkActiveChangedFn fn) override { | NotifyNetworkActiveChangedFn fn) override { | ||||
Show All 36 Lines |