mirror of
https://github.com/monero-project/monero.git
synced 2026-07-28 14:47:15 -07:00
wallet: derive encrypted payment ID dummy/real status from tx.extra, not cd.dests
Also applies the same payment ID display fix to on_describe_transfer in wallet_rpc_server.cpp.
This commit is contained in:
@@ -7921,6 +7921,8 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes,
|
||||
if (e.is_integrated)
|
||||
is_dummy = false;
|
||||
|
||||
CHECK_AND_ASSERT_MES(is_dummy == (payment_id8 == crypto::null_hash8), false, "Bad loaded tx: mismatched payment ID info");
|
||||
|
||||
if (is_dummy)
|
||||
{
|
||||
payment_id_string += std::string("dummy encrypted payment ID");
|
||||
@@ -7952,7 +7954,7 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes,
|
||||
{
|
||||
const tx_destination_entry &entry = cd.splitted_dsts[d];
|
||||
std::string address, standard_address = get_account_address_as_str(m_wallet->nettype(), entry.is_subaddress, entry.addr);
|
||||
if (has_encrypted_payment_id && !entry.is_subaddress && standard_address != entry.original)
|
||||
if (has_encrypted_payment_id && !entry.is_subaddress)
|
||||
{
|
||||
address = get_account_integrated_address_as_str(m_wallet->nettype(), entry.addr, payment_id8);
|
||||
address += std::string(" (" + standard_address + " with encrypted payment id " + epee::string_tools::pod_to_hex(payment_id8) + ")");
|
||||
|
||||
@@ -122,8 +122,15 @@ bool UnsignedTransactionImpl::checkLoadedTx(const std::function<size_t()> get_nu
|
||||
{
|
||||
if (!payment_id_string.empty())
|
||||
payment_id_string += ", ";
|
||||
payment_id_string = std::string("encrypted payment ID ") + epee::string_tools::pod_to_hex(payment_id8);
|
||||
has_encrypted_payment_id = true;
|
||||
if (payment_id8 == crypto::null_hash8)
|
||||
{
|
||||
payment_id_string += std::string("dummy encrypted payment ID");
|
||||
}
|
||||
else
|
||||
{
|
||||
payment_id_string += std::string("encrypted payment ID ") + epee::string_tools::pod_to_hex(payment_id8);
|
||||
has_encrypted_payment_id = true;
|
||||
}
|
||||
}
|
||||
else if (cryptonote::get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))
|
||||
{
|
||||
|
||||
@@ -1567,7 +1567,7 @@ namespace tools
|
||||
{
|
||||
const cryptonote::tx_destination_entry &entry = cd.splitted_dsts[d];
|
||||
std::string address = cryptonote::get_account_address_as_str(m_wallet->nettype(), entry.is_subaddress, entry.addr);
|
||||
if (has_encrypted_payment_id && !entry.is_subaddress && address != entry.original)
|
||||
if (has_encrypted_payment_id && !entry.is_subaddress)
|
||||
address = cryptonote::get_account_integrated_address_as_str(m_wallet->nettype(), entry.addr, payment_id8);
|
||||
auto i = tx_dests.find(entry.addr);
|
||||
if (i == tx_dests.end())
|
||||
|
||||
Reference in New Issue
Block a user