forked from lthn/blockchain
renamed alias member to proper name - fixed in wallet
This commit is contained in:
parent
7230f7a12e
commit
96cdd25ac5
4 changed files with 15 additions and 15 deletions
|
|
@ -774,9 +774,9 @@ bool print_wti(const tools::wallet_public::wallet_transfer_info& wti)
|
||||||
|
|
||||||
static const std::string separator = ", ";
|
static const std::string separator = ", ";
|
||||||
std::string remote_side;
|
std::string remote_side;
|
||||||
if (!wti.recipients_aliases.empty())
|
if (!wti.remote_aliases.empty())
|
||||||
{
|
{
|
||||||
for (auto it : wti.recipients_aliases)
|
for (auto it : wti.remote_aliases)
|
||||||
remote_side += remote_side.empty() ? it : (separator + it);
|
remote_side += remote_side.empty() ? it : (separator + it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -314,8 +314,8 @@ void wallet2::fetch_tx_global_indixes(const std::list<std::reference_wrapper<con
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t height, const currency::block& b, const std::vector<uint64_t>* pglobal_indexes)
|
void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t height, const currency::block& b, const std::vector<uint64_t>* pglobal_indexes)
|
||||||
{
|
{
|
||||||
std::vector<std::string> recipients, recipients_aliases;
|
std::vector<std::string> recipients, remote_aliases;
|
||||||
process_unconfirmed(tx, recipients, recipients_aliases);
|
process_unconfirmed(tx, recipients, remote_aliases);
|
||||||
std::vector<size_t> outs;
|
std::vector<size_t> outs;
|
||||||
uint64_t tx_money_got_in_outs = 0;
|
uint64_t tx_money_got_in_outs = 0;
|
||||||
crypto::public_key tx_pub_key = null_pkey;
|
crypto::public_key tx_pub_key = null_pkey;
|
||||||
|
|
@ -682,7 +682,7 @@ void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t
|
||||||
{//this actually is transfer transaction, notify about spend
|
{//this actually is transfer transaction, notify about spend
|
||||||
if (tx_money_spent_in_ins > tx_money_got_in_outs)
|
if (tx_money_spent_in_ins > tx_money_got_in_outs)
|
||||||
{//usual transfer
|
{//usual transfer
|
||||||
handle_money_spent2(b, tx, tx_money_spent_in_ins - (tx_money_got_in_outs+get_tx_fee(tx)), mtd, recipients, recipients_aliases);
|
handle_money_spent2(b, tx, tx_money_spent_in_ins - (tx_money_got_in_outs+get_tx_fee(tx)), mtd, recipients, remote_aliases);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//strange transfer, seems that in one transaction have transfers from different wallets.
|
{//strange transfer, seems that in one transaction have transfers from different wallets.
|
||||||
|
|
@ -705,7 +705,7 @@ void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t
|
||||||
else if (mtd.spent_indices.size())
|
else if (mtd.spent_indices.size())
|
||||||
{
|
{
|
||||||
// multisig spend detected
|
// multisig spend detected
|
||||||
handle_money_spent2(b, tx, 0, mtd, recipients, recipients_aliases);
|
handle_money_spent2(b, tx, 0, mtd, recipients, remote_aliases);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1314,27 +1314,27 @@ void wallet2::handle_money_spent2(const currency::block& b,
|
||||||
uint64_t amount,
|
uint64_t amount,
|
||||||
const money_transfer2_details& td,
|
const money_transfer2_details& td,
|
||||||
const std::vector<std::string>& recipients,
|
const std::vector<std::string>& recipients,
|
||||||
const std::vector<std::string>& recipients_aliases)
|
const std::vector<std::string>& remote_aliases)
|
||||||
{
|
{
|
||||||
m_transfer_history.push_back(AUTO_VAL_INIT(wallet_public::wallet_transfer_info()));
|
m_transfer_history.push_back(AUTO_VAL_INIT(wallet_public::wallet_transfer_info()));
|
||||||
wallet_public::wallet_transfer_info& wti = m_transfer_history.back();
|
wallet_public::wallet_transfer_info& wti = m_transfer_history.back();
|
||||||
wti.is_income = false;
|
wti.is_income = false;
|
||||||
|
|
||||||
wti.remote_addresses = recipients;
|
wti.remote_addresses = recipients;
|
||||||
wti.recipients_aliases = recipients_aliases;
|
wti.remote_aliases = remote_aliases;
|
||||||
prepare_wti(wti, get_block_height(b), get_block_datetime(b), in_tx, amount, td);
|
prepare_wti(wti, get_block_height(b), get_block_datetime(b), in_tx, amount, td);
|
||||||
WLT_LOG_L1("[MONEY SPENT]: " << epee::serialization::store_t_to_json(wti));
|
WLT_LOG_L1("[MONEY SPENT]: " << epee::serialization::store_t_to_json(wti));
|
||||||
rise_on_transfer2(wti);
|
rise_on_transfer2(wti);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
void wallet2::process_unconfirmed(const currency::transaction& tx, std::vector<std::string>& recipients, std::vector<std::string>& recipients_aliases)
|
void wallet2::process_unconfirmed(const currency::transaction& tx, std::vector<std::string>& recipients, std::vector<std::string>& remote_aliases)
|
||||||
{
|
{
|
||||||
auto unconf_it = m_unconfirmed_txs.find(get_transaction_hash(tx));
|
auto unconf_it = m_unconfirmed_txs.find(get_transaction_hash(tx));
|
||||||
if (unconf_it != m_unconfirmed_txs.end())
|
if (unconf_it != m_unconfirmed_txs.end())
|
||||||
{
|
{
|
||||||
wallet_public::wallet_transfer_info& wti = unconf_it->second;
|
wallet_public::wallet_transfer_info& wti = unconf_it->second;
|
||||||
recipients = wti.remote_addresses;
|
recipients = wti.remote_addresses;
|
||||||
recipients_aliases = wti.recipients_aliases;
|
remote_aliases = wti.remote_aliases;
|
||||||
|
|
||||||
m_unconfirmed_txs.erase(unconf_it);
|
m_unconfirmed_txs.erase(unconf_it);
|
||||||
}
|
}
|
||||||
|
|
@ -3267,7 +3267,7 @@ void wallet2::get_recent_transfers_history(std::vector<wallet_public::wallet_tra
|
||||||
|
|
||||||
if (wti.remote_addresses.size() == 1)
|
if (wti.remote_addresses.size() == 1)
|
||||||
{
|
{
|
||||||
wti.recipients_aliases = get_aliases_for_address(wti.remote_addresses[0]);
|
wti.remote_aliases = get_aliases_for_address(wti.remote_addresses[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trs.size() >= count)
|
if (trs.size() >= count)
|
||||||
|
|
@ -3300,7 +3300,7 @@ void wallet2::wti_to_csv_entry(std::ostream& ss, const wallet_public::wallet_tra
|
||||||
ss << wti.tx_blob_size << ",";
|
ss << wti.tx_blob_size << ",";
|
||||||
ss << epee::string_tools::buff_to_hex_nodelimer(wti.payment_id) << ",";
|
ss << epee::string_tools::buff_to_hex_nodelimer(wti.payment_id) << ",";
|
||||||
ss << "[";
|
ss << "[";
|
||||||
std::copy(wti.recipients_aliases.begin(), wti.recipients_aliases.end(), std::ostream_iterator<std::string>(ss, " "));
|
std::copy(wti.remote_aliases.begin(), wti.remote_aliases.end(), std::ostream_iterator<std::string>(ss, " "));
|
||||||
ss << "]" << ",";
|
ss << "]" << ",";
|
||||||
ss << (wti.is_income ? "in" : "out") << ",";
|
ss << (wti.is_income ? "in" : "out") << ",";
|
||||||
ss << (wti.is_service ? "[SERVICE]" : "") << (wti.is_mixing ? "[MIXINS]" : "") << (wti.is_mining ? "[MINING]" : "") << ",";
|
ss << (wti.is_service ? "[SERVICE]" : "") << (wti.is_mixing ? "[MIXINS]" : "") << (wti.is_mining ? "[MINING]" : "") << ",";
|
||||||
|
|
@ -5081,7 +5081,7 @@ void wallet2::add_sent_unconfirmed_tx(const currency::transaction& tx,
|
||||||
//unconfirmed_wti.tx = tx;
|
//unconfirmed_wti.tx = tx;
|
||||||
unconfirmed_wti.remote_addresses = recipients;
|
unconfirmed_wti.remote_addresses = recipients;
|
||||||
for (auto addr : recipients)
|
for (auto addr : recipients)
|
||||||
unconfirmed_wti.recipients_aliases.push_back(get_alias_for_address(addr));
|
unconfirmed_wti.remote_aliases.push_back(get_alias_for_address(addr));
|
||||||
unconfirmed_wti.is_income = false;
|
unconfirmed_wti.is_income = false;
|
||||||
unconfirmed_wti.selected_indicies = selected_indicies;
|
unconfirmed_wti.selected_indicies = selected_indicies;
|
||||||
/*TODO: add selected_indicies to read_money_transfer2_details_from_tx in case of performance problems*/
|
/*TODO: add selected_indicies to read_money_transfer2_details_from_tx in case of performance problems*/
|
||||||
|
|
|
||||||
|
|
@ -1160,7 +1160,7 @@ namespace boost
|
||||||
a & x.is_income;
|
a & x.is_income;
|
||||||
a & x.td;
|
a & x.td;
|
||||||
a & x.tx;
|
a & x.tx;
|
||||||
a & x.recipients_aliases;
|
a & x.remote_aliases;
|
||||||
a & x.comment;
|
a & x.comment;
|
||||||
a & x.contract;
|
a & x.contract;
|
||||||
a & x.selected_indicies;
|
a & x.selected_indicies;
|
||||||
|
|
|
||||||
|
|
@ -1780,7 +1780,7 @@ bool gen_wallet_alias_via_special_wallet_funcs::c1(currency::core& c, size_t ev_
|
||||||
uint64_t biggest_alias_reward = get_alias_coast_from_fee("a", TESTS_DEFAULT_FEE);
|
uint64_t biggest_alias_reward = get_alias_coast_from_fee("a", TESTS_DEFAULT_FEE);
|
||||||
std::shared_ptr<wlt_lambda_on_transfer2_wrapper> l(new wlt_lambda_on_transfer2_wrapper(
|
std::shared_ptr<wlt_lambda_on_transfer2_wrapper> l(new wlt_lambda_on_transfer2_wrapper(
|
||||||
[biggest_alias_reward](const tools::wallet_public::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) -> bool {
|
[biggest_alias_reward](const tools::wallet_public::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) -> bool {
|
||||||
return std::count(wti.recipients_aliases.begin(), wti.recipients_aliases.end(), "minerminer") == 1 &&
|
return std::count(wti.remote_aliases.begin(), wti.remote_aliases.end(), "minerminer") == 1 &&
|
||||||
wti.amount == biggest_alias_reward;
|
wti.amount == biggest_alias_reward;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue