mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Fixes for 'std::bad_alloc' issue.
This commit is contained in:
parent
96deee0b2d
commit
fd4efd46ea
7 changed files with 58 additions and 10 deletions
|
@ -294,14 +294,26 @@ extern "C"
|
|||
return true;
|
||||
}
|
||||
|
||||
void load_wallet(char *path, char *password, int32_t nettype)
|
||||
bool load_wallet(char *path, char *password, int32_t nettype)
|
||||
{
|
||||
nice(19);
|
||||
Monero::NetworkType networkType = static_cast<Monero::NetworkType>(nettype);
|
||||
Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->openWallet(std::string(path), std::string(password), networkType);
|
||||
Monero::WalletManager *walletManager = Monero::WalletManagerFactory::getWalletManager();
|
||||
Monero::Wallet *wallet = walletManager->openWallet(std::string(path), std::string(password), networkType);
|
||||
int status;
|
||||
std::string errorString;
|
||||
|
||||
wallet->statusWithErrorString(status, errorString);
|
||||
change_current_wallet(wallet);
|
||||
|
||||
return !(status != Monero::Wallet::Status_Ok || !errorString.empty());
|
||||
}
|
||||
|
||||
char *error_string() {
|
||||
return strdup(get_current_wallet()->errorString().c_str());
|
||||
}
|
||||
|
||||
|
||||
bool is_wallet_exist(char *path)
|
||||
{
|
||||
return Monero::WalletManagerFactory::getWalletManager()->walletExists(std::string(path));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue