diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index dbf21477..1d24c32d 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -675,8 +675,15 @@ void simple_wallet::on_tor_status_change(const std::string& state) human_message = "Successfully created stream"; else if (state == TOR_LIB_STATE_FAILED) human_message = "Failed created stream"; + else if (state == WALLET_LIB_STATE_SENDING) + human_message = "Sending transaction..."; + else if (state == WALLET_LIB_SENT_SUCCESS) + human_message = "Successfully sent!"; + else if (state == WALLET_LIB_SEND_FAILED) + human_message = "Sending failed"; - message_writer(epee::log_space::console_color_yellow, true, std::string("TOR")) << human_message; + + message_writer(epee::log_space::console_color_yellow, true, std::string("[TOR]: ")) << human_message; } //---------------------------------------------------------------------------------------------------- bool simple_wallet::refresh(const std::vector& args) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 2dd9c27b..07a098b7 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4621,12 +4621,15 @@ void wallet2::send_transaction_to_network(const transaction& tx) currency::NOTIFY_OR_INVOKE_NEW_TRANSACTIONS::request p2p_req = AUTO_VAL_INIT(p2p_req); currency::NOTIFY_OR_INVOKE_NEW_TRANSACTIONS::response p2p_rsp = AUTO_VAL_INIT(p2p_rsp); p2p_req.txs.push_back(t_serializable_object_to_blob(tx)); + this->notify_state_change(WALLET_LIB_STATE_SENDING); epee::net_utils::invoke_remote_command2(NOTIFY_OR_INVOKE_NEW_TRANSACTIONS::ID, p2p_req, p2p_rsp, p2p_client); p2p_client.disconnect(); if (p2p_rsp.code == API_RETURN_CODE_OK) { + this->notify_state_change(WALLET_LIB_SENT_SUCCESS); break; } + this->notify_state_change(WALLET_LIB_SEND_FAILED); //checking if transaction got relayed to other nodes and //return; } diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h index c2636d70..f836c8a8 100644 --- a/src/wallet/wallet_errors.h +++ b/src/wallet/wallet_errors.h @@ -16,6 +16,12 @@ // TODO: get rid of all these types, leave only wallet_error with a string message and string/enum error designator + +#define WALLET_LIB_STATE_SENDING "STATE_SENDING" +#define WALLET_LIB_SENT_SUCCESS "STATE_SENT_SUCCESS" +#define WALLET_LIB_SEND_FAILED "STATE_SEND_FAILED" + + namespace tools { namespace error