1
0
Fork 0
forked from lthn/blockchain

added status feedback from wallet\tor layer

This commit is contained in:
cryptozoidberg 2022-03-22 23:38:43 +02:00
parent 72bfd89717
commit 58931cb77b
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
4 changed files with 13 additions and 3 deletions

View file

@ -658,6 +658,11 @@ void simple_wallet::on_message(i_wallet2_callback::message_severity severity, co
message_writer(color, true, std::string()) << m;
}
//----------------------------------------------------------------------------------------------------
void simple_wallet::on_tor_status_change(const std::string& state)
{
message_writer(epee::log_space::console_color_yellow, false, std::string("TOR")) << state;
}
//----------------------------------------------------------------------------------------------------
bool simple_wallet::refresh(const std::vector<std::string>& args)
{
if (m_offline_mode)

View file

@ -98,6 +98,7 @@ namespace currency
virtual void on_new_block(uint64_t height, const currency::block& block) override;
virtual void on_transfer2(const tools::wallet_public::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) override;
virtual void on_message(i_wallet2_callback::message_severity severity, const std::string& m) override;
virtual void on_tor_status_change(const std::string& state) override;
//----------------------------------------------------------

View file

@ -32,6 +32,8 @@ using namespace epee;
#include "common/encryption_filter.h"
#include "crypto/bitcoin/sha256_helper.h"
#include "common/tor_helper.h"
#include "storages/levin_abstract_invoke2.h"
using namespace currency;
@ -4619,9 +4621,10 @@ 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));
std::string blob;
epee::serialization::store_t_to_binary(p2p_req, blob);
p2p_client.invoke(NOTIFY_OR_INVOKE_NEW_TRANSACTIONS::ID, blob);
//std::string blob;
//epee::serialization::store_t_to_binary(p2p_req, blob);
epee::net_utils::invoke_remote_command2(NOTIFY_OR_INVOKE_NEW_TRANSACTIONS::ID, p2p_req, p2p_rsp, p2p_client);
//p2p_client.invoke(NOTIFY_OR_INVOKE_NEW_TRANSACTIONS::ID, blob,m );
p2p_client.disconnect();
//checking if transaction got relayed to other nodes and

View file

@ -41,6 +41,7 @@
#include "currency_core/bc_escrow_service.h"
#include "common/pod_array_file_container.h"
#include "wallet_chain_shortener.h"
#include "tor-connect/torlib/tor_lib_iface.h"
#define WALLET_DEFAULT_TX_SPENDABLE_AGE 10