mirror of
https://github.com/monero-project/monero.git
synced 2025-12-15 02:57:31 -05:00
libwallet_api: do not store wallet on close if status is not ok
This commit is contained in:
parent
63ba2447e2
commit
b1a5a937ff
2 changed files with 72 additions and 5 deletions
|
|
@ -267,16 +267,18 @@ bool WalletImpl::recover(const std::string &path, const std::string &seed)
|
|||
|
||||
bool WalletImpl::close()
|
||||
{
|
||||
clearStatus();
|
||||
|
||||
bool result = false;
|
||||
try {
|
||||
// LOG_PRINT_L0("Calling wallet::store...");
|
||||
m_wallet->store();
|
||||
// do not store wallet with invalid status
|
||||
if (status() == Status_Ok)
|
||||
m_wallet->store();
|
||||
// LOG_PRINT_L0("wallet::store done");
|
||||
// LOG_PRINT_L0("Calling wallet::stop...");
|
||||
m_wallet->stop();
|
||||
// LOG_PRINT_L0("wallet::stop done");
|
||||
result = true;
|
||||
clearStatus();
|
||||
} catch (const std::exception &e) {
|
||||
m_status = Status_Error;
|
||||
m_errorString = e.what();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue