aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-02 20:53:12 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-02-02 20:53:12 +0000
commitb5cb8861c731cd80176eb6e8e1dcaa36ec51b61e (patch)
tree31211b8fa1a7d5107e333b8b9a31946806b88b3c /src/cryptonote_core
parentMerge pull request #1656 (diff)
downloadmonero-b5cb8861c731cd80176eb6e8e1dcaa36ec51b61e.tar.xz
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.
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/cryptonote_format_utils.cpp2
1 files changed, 2 insertions, 0 deletions
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;
}