From e52ff16733164b56ee911abf2fce1768193c2aca Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 11 Apr 2024 17:00:36 +0200 Subject: [PATCH] wallet2: fixed height upper limit in decoy request for pre-HF4 PoS mining (effective mostly for the testnet) --- src/wallet/wallet2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index b1b9b376..b15a6172 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4581,7 +4581,7 @@ bool wallet2::prepare_and_sign_pos_block(const mining_context& cxt, uint64_t ful if (m_required_decoys_count > 0 && !is_auditable()) { COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request decoys_req = AUTO_VAL_INIT(decoys_req); - decoys_req.height_upper_limit = 0; // TODO @#@# maybe use m_last_pow_block_h like Zarcanum? + decoys_req.height_upper_limit = std::min(m_last_pow_block_h, m_last_known_daemon_height > m_core_runtime_config.min_coinstake_age ? m_last_known_daemon_height - m_core_runtime_config.min_coinstake_age : m_last_pow_block_h); decoys_req.use_forced_mix_outs = false; decoys_req.decoys_count = m_required_decoys_count + 1; // one more to be able to skip a decoy in case it hits the real output decoys_req.amounts.push_back(pe.amount); // request one batch of decoys