diff options
| author | Riccardo Spagni <ric@spagni.net> | 2019-04-15 09:12:19 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2019-04-15 09:12:20 +0200 |
| commit | 37aea526a9b980ef0cb47403a7a587390baa248f (patch) | |
| tree | 34ef86d6da9707f3324a8166d34edfeb605a146c /src/wallet/api/wallet_manager.cpp | |
| parent | 37345921ece7280c2fde031e2a1e32bfbac0479c (diff) | |
| parent | c68fe7873bec21d6163b10d9e8f7c8d4d53f5a23 (diff) | |
| download | monzero-core-37aea526a9b980ef0cb47403a7a587390baa248f.tar.gz monzero-core-37aea526a9b980ef0cb47403a7a587390baa248f.tar.xz monzero-core-37aea526a9b980ef0cb47403a7a587390baa248f.zip | |
Merge pull request #5355
c68fe787 device/trezor: add button pressed request (Dusan Klinec)
827f52ad wallet: API changes to enable passphrase entry (Dusan Klinec)
Diffstat (limited to 'src/wallet/api/wallet_manager.cpp')
| -rw-r--r-- | src/wallet/api/wallet_manager.cpp | 15 |
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 { |
