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
This commit is contained in:
@@ -7477,6 +7477,8 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes,
|
|||||||
if (e.is_integrated)
|
if (e.is_integrated)
|
||||||
is_dummy = false;
|
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)
|
if (is_dummy)
|
||||||
{
|
{
|
||||||
payment_id_string += std::string("dummy encrypted payment ID");
|
payment_id_string += std::string("dummy encrypted payment ID");
|
||||||
@@ -7508,7 +7510,7 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes,
|
|||||||
{
|
{
|
||||||
const tx_destination_entry &entry = cd.splitted_dsts[d];
|
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);
|
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 = 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) + ")");
|
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())
|
if (!payment_id_string.empty())
|
||||||
payment_id_string += ", ";
|
payment_id_string += ", ";
|
||||||
payment_id_string = std::string("encrypted payment ID ") + epee::string_tools::pod_to_hex(payment_id8);
|
if (payment_id8 == crypto::null_hash8)
|
||||||
has_encrypted_payment_id = true;
|
{
|
||||||
|
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))
|
else if (cryptonote::get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1580,7 +1580,7 @@ namespace tools
|
|||||||
{
|
{
|
||||||
const cryptonote::tx_destination_entry &entry = cd.splitted_dsts[d];
|
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);
|
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);
|
address = cryptonote::get_account_integrated_address_as_str(m_wallet->nettype(), entry.addr, payment_id8);
|
||||||
auto i = tx_dests.find(entry.addr);
|
auto i = tx_dests.find(entry.addr);
|
||||||
if (i == tx_dests.end())
|
if (i == tx_dests.end())
|
||||||
|
|||||||
Reference in New Issue
Block a user