aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-06-16 15:35:55 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-06-16 15:36:20 +0100
commitf6da25a32e944b028b7d9c2e4a0769543d5ba19e (patch)
tree26cf95cbffe98a31aea70435f97cf25191b09785 /src
parentMerge pull request #321 (diff)
downloadmonero-f6da25a32e944b028b7d9c2e4a0769543d5ba19e.tar.xz
Fix standard address deserialization
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_basic_impl.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/cryptonote_core/cryptonote_basic_impl.cpp b/src/cryptonote_core/cryptonote_basic_impl.cpp
index 839c6ad1e..abdef64f9 100644
--- a/src/cryptonote_core/cryptonote_basic_impl.cpp
+++ b/src/cryptonote_core/cryptonote_basic_impl.cpp
@@ -205,15 +205,25 @@ namespace cryptonote {
return false;
}
- integrated_address iadr;
- if (!::serialization::parse_binary(data, iadr))
+ if (has_payment_id)
{
- LOG_PRINT_L1("Account public address keys can't be parsed");
- return false;
+ integrated_address iadr;
+ if (!::serialization::parse_binary(data, iadr))
+ {
+ LOG_PRINT_L1("Account public address keys can't be parsed");
+ return false;
+ }
+ adr = iadr.adr;
+ payment_id = iadr.payment_id;
+ }
+ else
+ {
+ if (!::serialization::parse_binary(data, adr))
+ {
+ LOG_PRINT_L1("Account public address keys can't be parsed");
+ return false;
+ }
}
-
- adr = iadr.adr;
- payment_id = iadr.payment_id;
if (!crypto::check_key(adr.m_spend_public_key) || !crypto::check_key(adr.m_view_public_key))
{