From a11bdf39f2c6f229f805c729be38bab8640d2b8c Mon Sep 17 00:00:00 2001 From: sowle Date: Mon, 4 May 2020 14:57:29 +0300 Subject: [PATCH] wallet2: correct using of extra_alias_entry / extra_alias_entry_old --- src/wallet/wallet2.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 5477153f..637d0b3a 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3050,7 +3050,11 @@ void wallet2::request_alias_registration(const currency::extra_alias_entry& ai, std::vector destinations; std::vector extra; std::vector attachments; - extra.push_back(ai); + + if (get_top_block_height() > m_core_runtime_config.hard_fork_02_starts_after_height) + extra.push_back(ai); + else + extra.push_back(ai.to_old()); currency::tx_destination_entry tx_dest_alias_reward; tx_dest_alias_reward.addr.resize(1); @@ -3080,7 +3084,12 @@ void wallet2::request_alias_update(currency::extra_alias_entry& ai, currency::tr std::vector destinations; std::vector extra; std::vector attachments; - extra.push_back(ai); + + if (get_top_block_height() > m_core_runtime_config.hard_fork_02_starts_after_height) + extra.push_back(ai); + else + extra.push_back(ai.to_old()); + transfer(destinations, 0, 0, fee, extra, attachments, detail::ssi_digit, tx_dust_policy(DEFAULT_DUST_THRESHOLD), res_tx, CURRENCY_TO_KEY_OUT_RELAXED, false); } //----------------------------------------------------------------------------------------------------