From b5cb8861c731cd80176eb6e8e1dcaa36ec51b61e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 2 Feb 2017 20:53:12 +0000 Subject: core: fix integrated addresses breaking with auto zero change Zero change is sent to a random address, which confuses the code which determines which key to use to encrypt the payment id. Ignore zero amounts for this purpose, so the payment id gets encrypted with the real destination's key. --- src/cryptonote_core/cryptonote_format_utils.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 70ba7ee18..2e6917878 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -443,6 +443,8 @@ namespace cryptonote { if (!memcmp(&destinations[n].addr, &sender_keys.m_account_address, sizeof(destinations[0].addr))) continue; + if (destinations[n].amount == 0) + continue; if (memcmp(&destinations[n].addr, &destinations[0].addr, sizeof(destinations[0].addr))) return null_pkey; } -- cgit v1.2.3