aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet_manager.cpp
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2019-03-26 12:29:08 +0100
committerDusan Klinec <dusan.klinec@gmail.com>2019-04-05 22:17:50 +0200
commit827f52add07a562185b8b5445b252132481cb6b0 (patch)
tree070c7b704d6572b89d767d1c386557cb25aebd16 /src/wallet/api/wallet_manager.cpp
parentMerge pull request #5390 (diff)
downloadmonero-827f52add07a562185b8b5445b252132481cb6b0.tar.xz
wallet: API changes to enable passphrase entry
Diffstat (limited to 'src/wallet/api/wallet_manager.cpp')
-rw-r--r--src/wallet/api/wallet_manager.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
index f584e88ac..ef2ed2015 100644
--- a/src/wallet/api/wallet_manager.cpp
+++ b/src/wallet/api/wallet_manager.cpp
@@ -57,9 +57,14 @@ Wallet *WalletManagerImpl::createWallet(const std::string &path, const std::stri
return wallet;
}
-Wallet *WalletManagerImpl::openWallet(const std::string &path, const std::string &password, NetworkType nettype, uint64_t kdf_rounds)
+Wallet *WalletManagerImpl::openWallet(const std::string &path, const std::string &password, NetworkType nettype, uint64_t kdf_rounds, WalletListener * listener)
{
WalletImpl * wallet = new WalletImpl(nettype, kdf_rounds);
+ wallet->setListener(listener);
+ if (listener){
+ listener->onSetWallet(wallet);
+ }
+
wallet->open(path, password);
//Refresh addressBook
wallet->addressBook()->refresh();
@@ -122,9 +127,15 @@ Wallet *WalletManagerImpl::createWalletFromDevice(const std::string &path,
const std::string &deviceName,
uint64_t restoreHeight,
const std::string &subaddressLookahead,
- uint64_t kdf_rounds)
+ uint64_t kdf_rounds,
+ WalletListener * listener)
{
WalletImpl * wallet = new WalletImpl(nettype, kdf_rounds);
+ wallet->setListener(listener);
+ if (listener){
+ listener->onSetWallet(wallet);
+ }
+
if(restoreHeight > 0){
wallet->setRefreshFromBlockHeight(restoreHeight);
} else {