diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index ac550fb6..18d97672 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -2832,7 +2832,11 @@ bool blockchain_storage::get_random_outs_for_amounts2(const COMMAND_RPC_GET_RAND { CRITICAL_REGION_LOCAL(m_read_lock); LOG_PRINT_L3("[get_random_outs_for_amounts] amounts: " << req.amounts.size()); - std::map amounts_to_up_index_limit_cache; + std::map amounts_to_up_index_limit_cache; + uint64_t count_zarcanum_blocks = 0; + if(is_hardfork_active(ZANO_HARDFORK_04_ZARCANUM)) + count_zarcanum_blocks = this->get_current_blockchain_size() - m_core_runtime_config.hard_forks.m_height_the_hardfork_n_active_after[ZANO_HARDFORK_04_ZARCANUM]; + for (size_t i = 0; i != req.amounts.size(); i++) { @@ -2842,7 +2846,7 @@ bool blockchain_storage::get_random_outs_for_amounts2(const COMMAND_RPC_GET_RAND result_outs.amount = amount; bool r = false; - if (amount == 0) + if (amount == 0 && count_zarcanum_blocks > 20000) { //zarcanum era inputs r = get_target_outs_for_postzarcanum(req, req.amounts[i], result_outs, amounts_to_up_index_limit_cache); diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 6029d5f5..2a1ce542 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5925,6 +5925,7 @@ bool wallet2::prepare_tx_sources(size_t fake_outputs_count, std::vectorcall_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS2(req, daemon_resp); THROW_IF_FALSE_WALLET_EX(r, error::no_connection_to_daemon, "getrandom_outs2.bin"); if(daemon_resp.status == API_RETURN_CODE_FAIL) @@ -5944,6 +5945,7 @@ bool wallet2::prepare_tx_sources(size_t fake_outputs_count, std::vector scanty_outs;