From 0486a5f1e9058313e370c5f8dc2c258c2f3404f8 Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Wed, 18 Jul 2018 18:02:26 +0300 Subject: [PATCH 1/3] fixed issue #1050 --- src/rpc/cli.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index add2f6a..5ca1447 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -103,6 +103,11 @@ void cli::run() } else std::cout << itr->second( result, args ) << "\n"; + + if (method == "quit") + { + stop(); + } } catch ( const fc::exception& e ) { From 535fc869b505af528043760adbe5a9424ca2c485 Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Thu, 19 Jul 2018 09:48:47 +0300 Subject: [PATCH 2/3] remove hard coded method check to result check from quit command --- src/rpc/cli.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index 5ca1447..2788f49 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -14,6 +14,12 @@ # endif #endif +#ifdef WIN32 +# include +#else +# include +#endif + namespace fc { namespace rpc { static std::vector& cli_commands() @@ -104,9 +110,9 @@ void cli::run() else std::cout << itr->second( result, args ) << "\n"; - if (method == "quit") + if (result.is_integer() && result.as_int64() == SIGQUIT) { - stop(); + break; } } catch ( const fc::exception& e ) From 18206552fc60450a628056646eeabd0618868e61 Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Fri, 20 Jul 2018 16:44:31 +0300 Subject: [PATCH 3/3] throwing fc:canceled_exception for quit cli wallet command --- src/rpc/cli.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index 2788f49..0021ada 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -14,12 +14,6 @@ # endif #endif -#ifdef WIN32 -# include -#else -# include -#endif - namespace fc { namespace rpc { static std::vector& cli_commands() @@ -109,15 +103,15 @@ void cli::run() } else std::cout << itr->second( result, args ) << "\n"; - - if (result.is_integer() && result.as_int64() == SIGQUIT) - { - break; - } } catch ( const fc::exception& e ) { std::cout << e.to_detail_string() << "\n"; + + if (e.code() == fc::canceled_exception_code) + { + break; + } } } }