diff options
| author | João Barbosa <[email protected]> | 2018-09-22 00:53:25 +0100 |
|---|---|---|
| committer | João Barbosa <[email protected]> | 2018-10-18 23:26:06 +0100 |
| commit | d1b03b8e5f04a2cc9ebb985bd9a1aebd2068f757 (patch) | |
| tree | 15591cb226059861f5aaec4777dbc6c57de0af47 /src/interfaces/node.cpp | |
| parent | wallet: Add ListWalletDir utility (diff) | |
| download | discoin-d1b03b8e5f04a2cc9ebb985bd9a1aebd2068f757.tar.xz discoin-d1b03b8e5f04a2cc9ebb985bd9a1aebd2068f757.zip | |
interfaces: Add getWalletDir and listWalletDir to Node
Diffstat (limited to 'src/interfaces/node.cpp')
| -rw-r--r-- | src/interfaces/node.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index d95b41657..2b19e11f0 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -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; |