Skip to content

Commit

Permalink
Capture Ctrl+C in cli_wallet when not in daemon mode bitshares#1193
Browse files Browse the repository at this point in the history
  • Loading branch information
cogutvalera committed Aug 3, 2018
1 parent 0b353e0 commit 033ee7c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions programs/cli_wallet/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ int main( int argc, char** argv )
{
wallet_cli->register_api( wapi );
wallet_cli->start();

fc::set_signal_handler([&wallet_cli, &wapi, &wallet_file](int signal) {
ilog( "Captured CTRL+C not in daemon mode" );
wapi->save_wallet_file(wallet_file.generic_string());
wallet_cli->stop();
}, SIGINT);

wallet_cli->wait();
}
else
Expand Down

0 comments on commit 033ee7c

Please sign in to comment.