diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-16 15:35:55 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-16 15:36:20 +0100 |
commit | f6da25a32e944b028b7d9c2e4a0769543d5ba19e (patch) | |
tree | 26cf95cbffe98a31aea70435f97cf25191b09785 | |
parent | Merge pull request #321 (diff) | |
download | monero-f6da25a32e944b028b7d9c2e4a0769543d5ba19e.tar.xz |
Fix standard address deserialization
-rw-r--r-- | src/cryptonote_core/cryptonote_basic_impl.cpp | 24 |
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)) { |