mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
simplewallet: fix encrypted payment id note triggering on dummy ones
This commit is contained in:
parent
411f1b0ee3
commit
f8127831c7
1 changed files with 20 additions and 12 deletions
|
@ -5446,21 +5446,29 @@ void simple_wallet::on_money_received(uint64_t height, const crypto::hash &txid,
|
||||||
std::vector<tx_extra_field> tx_extra_fields;
|
std::vector<tx_extra_field> tx_extra_fields;
|
||||||
parse_tx_extra(tx.extra, tx_extra_fields); // failure ok
|
parse_tx_extra(tx.extra, tx_extra_fields); // failure ok
|
||||||
tx_extra_nonce extra_nonce;
|
tx_extra_nonce extra_nonce;
|
||||||
|
tx_extra_pub_key extra_pub_key;
|
||||||
|
crypto::hash8 payment_id8 = crypto::null_hash8;
|
||||||
|
if (find_tx_extra_field_by_type(tx_extra_fields, extra_pub_key))
|
||||||
|
{
|
||||||
|
const crypto::public_key &tx_pub_key = extra_pub_key.pub_key;
|
||||||
if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce))
|
if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce))
|
||||||
{
|
{
|
||||||
crypto::hash payment_id = crypto::null_hash;
|
|
||||||
crypto::hash8 payment_id8 = crypto::null_hash8;
|
|
||||||
if (get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))
|
if (get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))
|
||||||
{
|
{
|
||||||
|
m_wallet->get_account().get_device().decrypt_payment_id(payment_id8, tx_pub_key, m_wallet->get_account().get_keys().m_view_secret_key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (payment_id8 != crypto::null_hash8)
|
if (payment_id8 != crypto::null_hash8)
|
||||||
message_writer() <<
|
message_writer() <<
|
||||||
tr("NOTE: this transaction uses an encrypted payment ID: consider using subaddresses instead");
|
tr("NOTE: this transaction uses an encrypted payment ID: consider using subaddresses instead");
|
||||||
}
|
|
||||||
else if (get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))
|
crypto::hash payment_id = crypto::null_hash;
|
||||||
|
if (get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))
|
||||||
message_writer(console_color_red, false) <<
|
message_writer(console_color_red, false) <<
|
||||||
tr("WARNING: this transaction uses an unencrypted payment ID: these are obsolete and ignored. Use subaddresses instead.");
|
tr("WARNING: this transaction uses an unencrypted payment ID: these are obsolete and ignored. Use subaddresses instead.");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (unlock_time && !cryptonote::is_coinbase(tx))
|
if (unlock_time && !cryptonote::is_coinbase(tx))
|
||||||
message_writer() << tr("NOTE: This transaction is locked, see details with: show_transfer ") + epee::string_tools::pod_to_hex(txid);
|
message_writer() << tr("NOTE: This transaction is locked, see details with: show_transfer ") + epee::string_tools::pod_to_hex(txid);
|
||||||
if (m_auto_refresh_refreshing)
|
if (m_auto_refresh_refreshing)
|
||||||
|
|
Loading…
Reference in a new issue