1
0
Fork 0
forked from lthn/blockchain

added human readable tor status messages for simple wallet, disabled technical logs

This commit is contained in:
cryptozoidberg 2022-03-29 02:05:38 +03:00
parent 260e20d91f
commit 8221d28e61
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
2 changed files with 18 additions and 2 deletions

@ -1 +1 @@
Subproject commit 1c4e5d9c0cfe96dccf658de74d3e8294d9f51ad1
Subproject commit de54ace0f0e5178d663b184a85d4805c01b3d6b1

View file

@ -660,7 +660,23 @@ void simple_wallet::on_message(i_wallet2_callback::message_severity severity, co
//----------------------------------------------------------------------------------------------------
void simple_wallet::on_tor_status_change(const std::string& state)
{
message_writer(epee::log_space::console_color_yellow, false, std::string("TOR")) << state;
std::string human_message;
if (state == TOR_LIB_STATE_INITIALIZING)
human_message = "Initializing...";
else if (state == TOR_LIB_STATE_DOWNLOADING_CONSENSUS)
human_message = "Downloading consensus...";
else if (state == TOR_LIB_STATE_MAKING_TUNNEL_A)
human_message = "Building tunnel to A...";
else if (state == TOR_LIB_STATE_MAKING_TUNNEL_B)
human_message = "Building tunnel to B...";
else if (state == TOR_LIB_STATE_CREATING_STREAM)
human_message = "Creating stream...";
else if (state == TOR_LIB_STATE_SUCCESS)
human_message = "Successfully created stream";
else if (state == TOR_LIB_STATE_FAILED)
human_message = "Failed created stream";
message_writer(epee::log_space::console_color_yellow, true, std::string("TOR")) << human_message;
}
//----------------------------------------------------------------------------------------------------
bool simple_wallet::refresh(const std::vector<std::string>& args)