From 774a21394ab95bb3303bb99beb236570bafd5731 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 26 Jan 2017 21:33:36 +0100 Subject: Wallet API: Create wallet from keys --- src/wallet/api/wallet_manager.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/wallet/api/wallet_manager.cpp') 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(wallet); -- cgit v1.2.3