Wallet API: Create wallet from keys

This commit is contained in:
Jaquee 2017-01-26 21:33:36 +01:00
parent 4629ead8c5
commit 774a21394a
No known key found for this signature in database
GPG key ID: 384E52B09F45DC39
5 changed files with 178 additions and 0 deletions

View file

@ -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);