wallet_rpc_server: don't report integrated addresses for 0 payment ID

These are dummy ones
This commit is contained in:
moneromooo-monero 2019-06-22 17:50:28 +00:00
parent 19c0506e14
commit 4d0aadc081
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 6 additions and 3 deletions

View file

@ -1173,8 +1173,11 @@ namespace tools
crypto::hash payment_id; crypto::hash payment_id;
if(cryptonote::get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8)) if(cryptonote::get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))
{ {
desc.payment_id = epee::string_tools::pod_to_hex(payment_id8); if (payment_id8 != crypto::null_hash8)
has_encrypted_payment_id = true; {
desc.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))
{ {

View file

@ -272,7 +272,7 @@ class MultisigTest():
assert desc.amount_out == desc.amount_in - fee assert desc.amount_out == desc.amount_in - fee
assert desc.ring_size == 11 assert desc.ring_size == 11
assert desc.unlock_time == 0 assert desc.unlock_time == 0
assert desc.payment_id == '0000000000000000' assert not 'payment_id' in desc or desc.payment_id in ['', '0000000000000000']
assert desc.change_amount == desc.amount_in - 1000000000000 - fee assert desc.change_amount == desc.amount_in - 1000000000000 - fee
assert desc.change_address == self.wallet_address assert desc.change_address == self.wallet_address
assert desc.fee == fee assert desc.fee == fee