Skip to content

Commit

Permalink
fixed issue #1050 - added quit command in cli_wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
cogutvalera committed Jul 1, 2018
1 parent 4613b96 commit da4b84e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libraries/wallet/include/graphene/wallet/wallet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,12 @@ class wallet_api
*/
bool load_wallet_file(string wallet_filename = "");

/** Exits from Graphene wallet.
*
* The current wallet will be closed.
*/
void quit();

/** Saves the current wallet to the given filename.
*
* @warning This does not change the wallet filename that will be used for future
Expand Down Expand Up @@ -1815,4 +1821,5 @@ FC_API( graphene::wallet::wallet_api,
(blind_history)
(receive_blind_transfer)
(get_order_book)
(quit)
)
15 changes: 15 additions & 0 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,16 @@ class wallet_api_impl

return true;
}

void quit()
{
ilog( "exiting wallet ..." );
save_wallet_file();
ilog( "closed wallet successfully" );

FC_THROW("closed wallet successfully");
}

void save_wallet_file(string wallet_filename = "")
{
//
Expand Down Expand Up @@ -3762,6 +3772,11 @@ bool wallet_api::load_wallet_file( string wallet_filename )
return my->load_wallet_file( wallet_filename );
}

void wallet_api::quit()
{
my->quit();
}

void wallet_api::save_wallet_file( string wallet_filename )
{
my->save_wallet_file( wallet_filename );
Expand Down

0 comments on commit da4b84e

Please sign in to comment.