File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,16 @@ void DummyWalletInit::AddWalletOptions() const
34
34
35
35
const WalletInitInterface& g_wallet_init_interface = DummyWalletInit();
36
36
37
+ fs::path GetWalletDir ()
38
+ {
39
+ throw std::logic_error (" Wallet function called in non-wallet build." );
40
+ }
41
+
42
+ std::vector<fs::path> ListWalletDir ()
43
+ {
44
+ throw std::logic_error (" Wallet function called in non-wallet build." );
45
+ }
46
+
37
47
std::vector<std::shared_ptr<CWallet>> GetWallets ()
38
48
{
39
49
throw std::logic_error (" Wallet function called in non-wallet build." );
Original file line number Diff line number Diff line change 38
38
#include < univalue.h>
39
39
40
40
class CWallet ;
41
+ fs::path GetWalletDir ();
42
+ std::vector<fs::path> ListWalletDir ();
41
43
std::vector<std::shared_ptr<CWallet>> GetWallets ();
42
44
43
45
namespace interfaces {
@@ -218,6 +220,18 @@ class NodeImpl : public Node
218
220
LOCK (::cs_main);
219
221
return ::pcoinsTip->GetCoin (output, coin);
220
222
}
223
+ std::string getWalletDir () override
224
+ {
225
+ return GetWalletDir ().string ();
226
+ }
227
+ std::vector<std::string> listWalletDir () override
228
+ {
229
+ std::vector<std::string> paths;
230
+ for (auto & path : ListWalletDir ()) {
231
+ paths.push_back (path.string ());
232
+ }
233
+ return paths;
234
+ }
221
235
std::vector<std::unique_ptr<Wallet>> getWallets () override
222
236
{
223
237
std::vector<std::unique_ptr<Wallet>> wallets;
Original file line number Diff line number Diff line change @@ -173,6 +173,12 @@ class Node
173
173
// ! Get unspent outputs associated with a transaction.
174
174
virtual bool getUnspentOutput (const COutPoint& output, Coin& coin) = 0;
175
175
176
+ // ! Return default wallet directory.
177
+ virtual std::string getWalletDir () = 0;
178
+
179
+ // ! Return available wallets in wallet directory.
180
+ virtual std::vector<std::string> listWalletDir () = 0;
181
+
176
182
// ! Return interfaces for accessing wallets (if any).
177
183
virtual std::vector<std::unique_ptr<Wallet>> getWallets () = 0;
178
184
You can’t perform that action at this time.
0 commit comments