aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet_manager.cpp
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2017-01-26 21:33:36 +0100
committerJaquee <jaquee.monero@gmail.com>2017-01-30 23:28:09 +0100
commit774a21394ab95bb3303bb99beb236570bafd5731 (patch)
treebf11d1355b6f726392441feb7d8eff360ae92d2e /src/wallet/api/wallet_manager.cpp
parentMerge pull request #1618 (diff)
downloadmonero-774a21394ab95bb3303bb99beb236570bafd5731.tar.xz
Wallet API: Create wallet from keys
Diffstat (limited to 'src/wallet/api/wallet_manager.cpp')
-rw-r--r--src/wallet/api/wallet_manager.cpp16
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);