Skip to content

Commit

Permalink
Don't create a wallet when failed to create password file
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d committed Oct 17, 2018
1 parent 6e5992f commit 0a95422
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions programs/cleos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2549,6 +2549,7 @@ int main( int argc, char** argv ) {
createWallet->add_flag( "--to-console", print_console, localized("Print password to console."));
createWallet->set_callback([&wallet_name, &password_file, &print_console] {
EOSC_ASSERT( !password_file.empty() ^ print_console, "ERROR: Either indicate a file using \"--file\" or pass \"--to-console\"" );
EOSC_ASSERT( password_file.empty() || !std::ofstream(password_file.c_str()).fail(), "ERROR: Failed to create file in specified path" );

const auto& v = call(wallet_url, wallet_create, wallet_name);
std::cout << localized("Creating wallet: ${wallet_name}", ("wallet_name", wallet_name)) << std::endl;
Expand Down

0 comments on commit 0a95422

Please sign in to comment.