diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-07-27 14:27:47 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-07-27 14:27:47 -0500 |
commit | f739a3cbb8e95bc773756e7bc503448e61eed122 (patch) | |
tree | 00d9edecd0fff278a4546ff887261b30ba02aaa1 /src/simplewallet/simplewallet.cpp | |
parent | Merge pull request #4108 (diff) | |
parent | wallet: warn when payment IDs are used (diff) | |
download | monero-f739a3cbb8e95bc773756e7bc503448e61eed122.tar.xz |
Merge pull request #4109
2951436 wallet: warn when payment IDs are used (moneromooo-monero)
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 6a6f98a20..775b7c359 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3973,6 +3973,24 @@ void simple_wallet::on_money_received(uint64_t height, const crypto::hash &txid, tr("txid ") << txid << ", " << print_money(amount) << ", " << tr("idx ") << subaddr_index; + + const uint64_t warn_height = m_wallet->nettype() == TESTNET ? 1000000 : m_wallet->nettype() == STAGENET ? 50000 : 1650000; + if (height >= warn_height) + { + std::vector<tx_extra_field> tx_extra_fields; + parse_tx_extra(tx.extra, tx_extra_fields); // failure ok + tx_extra_nonce extra_nonce; + if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce)) + { + crypto::hash8 payment_id8 = crypto::null_hash8; + if (get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8)) + message_writer() << + tr("NOTE: this transaction uses an encrypted payment ID: consider using subaddresses instead"); + else + message_writer(console_color_red, false) << + tr("WARNING: this transaction uses an unencrypted payment ID: consider using subaddresses instead"); + } + } if (m_auto_refresh_refreshing) m_cmd_binder.print_prompt(); else @@ -4566,6 +4584,7 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri return true; } payment_id_seen = true; + message_writer() << tr("Unencrypted payment IDs are bad for privacy: ask the recipient to use subaddresses instead"); } uint64_t locked_blocks = 0; |