mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
interfaces: Add getWalletDir and listWalletDir to Node
This commit is contained in:
parent
fc4db35bfd
commit
d1b03b8e5f
3 changed files with 30 additions and 0 deletions
|
|
@ -38,6 +38,8 @@
|
|||
#include <univalue.h>
|
||||
|
||||
class CWallet;
|
||||
fs::path GetWalletDir();
|
||||
std::vector<fs::path> ListWalletDir();
|
||||
std::vector<std::shared_ptr<CWallet>> GetWallets();
|
||||
|
||||
namespace interfaces {
|
||||
|
|
@ -218,6 +220,18 @@ class NodeImpl : public Node
|
|||
LOCK(::cs_main);
|
||||
return ::pcoinsTip->GetCoin(output, coin);
|
||||
}
|
||||
std::string getWalletDir() override
|
||||
{
|
||||
return GetWalletDir().string();
|
||||
}
|
||||
std::vector<std::string> listWalletDir() override
|
||||
{
|
||||
std::vector<std::string> paths;
|
||||
for (auto& path : ListWalletDir()) {
|
||||
paths.push_back(path.string());
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
std::vector<std::unique_ptr<Wallet>> getWallets() override
|
||||
{
|
||||
std::vector<std::unique_ptr<Wallet>> wallets;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue