mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
interfaces: Add getWalletDir and listWalletDir to Node
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user