diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-06-25 14:49:30 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-06-25 14:49:30 -0500 |
commit | 473d984d88294fe6820c52094d96a0abcb8e9a90 (patch) | |
tree | 69ac017b982c55d8ce4e2b2005320eb77deb79e4 /src/wallet/api/wallet_manager.cpp | |
parent | Merge pull request #3677 (diff) | |
parent | Wallet API: add support for wallet creation from hardware device (diff) | |
download | monero-473d984d88294fe6820c52094d96a0abcb8e9a90.tar.xz |
Merge pull request #3921
8fc0cdb wallet2: lower default for subaddress lookahead when restoring with hardware (stoffu)
248310d Move parse_subaddress_lookahead() from simplewallet.cpp to util.cpp (stoffu)
46e90b7 Wallet API: add support for wallet creation from hardware device (stoffu)
Diffstat (limited to 'src/wallet/api/wallet_manager.cpp')
-rw-r--r-- | src/wallet/api/wallet_manager.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp index a63716576..99eadc82f 100644 --- a/src/wallet/api/wallet_manager.cpp +++ b/src/wallet/api/wallet_manager.cpp @@ -114,6 +114,26 @@ Wallet *WalletManagerImpl::createWalletFromKeys(const std::string &path, return wallet; } +Wallet *WalletManagerImpl::createWalletFromDevice(const std::string &path, + const std::string &password, + NetworkType nettype, + const std::string &deviceName, + uint64_t restoreHeight, + const std::string &subaddressLookahead) +{ + WalletImpl * wallet = new WalletImpl(nettype); + if(restoreHeight > 0){ + wallet->setRefreshFromBlockHeight(restoreHeight); + } + auto lookahead = tools::parse_subaddress_lookahead(subaddressLookahead); + if (lookahead) + { + wallet->setSubaddressLookahead(lookahead->first, lookahead->second); + } + wallet->recoverFromDevice(path, password, deviceName); + return wallet; +} + bool WalletManagerImpl::closeWallet(Wallet *wallet, bool store) { WalletImpl * wallet_ = dynamic_cast<WalletImpl*>(wallet); |