diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2017-01-30 17:09:38 -0600 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2017-01-30 17:09:38 -0600 |
| commit | 3cef7fbbb621e75b521ecfb0fa07b60aab2732ec (patch) | |
| tree | d486f1bc0ff67964d285468708e55038475e11dd /src/wallet/api/wallet_manager.cpp | |
| parent | ef987e5e49f18384577f5e5a3c3a3c8047fea3bc (diff) | |
| parent | 774a21394ab95bb3303bb99beb236570bafd5731 (diff) | |
| download | monzero-core-3cef7fbbb621e75b521ecfb0fa07b60aab2732ec.tar.gz monzero-core-3cef7fbbb621e75b521ecfb0fa07b60aab2732ec.tar.xz monzero-core-3cef7fbbb621e75b521ecfb0fa07b60aab2732ec.zip | |
Merge pull request 1635
774a213 Wallet API: Create wallet from keys (Jaqueeee)
Diffstat (limited to 'src/wallet/api/wallet_manager.cpp')
| -rw-r--r-- | src/wallet/api/wallet_manager.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp index 904338a72..fcb39d1f3 100644 --- a/src/wallet/api/wallet_manager.cpp +++ b/src/wallet/api/wallet_manager.cpp @@ -72,6 +72,22 @@ Wallet *WalletManagerImpl::recoveryWallet(const std::string &path, const std::st return wallet; } +Wallet *WalletManagerImpl::createWalletFromKeys(const std::string &path, + const std::string &language, + bool testnet, + uint64_t restoreHeight, + const std::string &addressString, + const std::string &viewKeyString, + const std::string &spendKeyString) +{ + WalletImpl * wallet = new WalletImpl(testnet); + if(restoreHeight > 0){ + wallet->setRefreshFromBlockHeight(restoreHeight); + } + wallet->recoverFromKeys(path, language, addressString, viewKeyString, spendKeyString); + return wallet; +} + bool WalletManagerImpl::closeWallet(Wallet *wallet) { WalletImpl * wallet_ = dynamic_cast<WalletImpl*>(wallet); |
