1
0
Fork 0
forked from lthn/blockchain

wallet2: fixed height upper limit in decoy request for pre-HF4 PoS mining (effective mostly for the testnet)

This commit is contained in:
sowle 2024-04-11 17:00:36 +02:00
parent e3d1956ba3
commit e52ff16733
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -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