add more outputs to requested_outputs_count

This commit is contained in:
wowario 2021-01-17 16:01:41 +03:00
parent 4b1d0f2340
commit 8fe9ce706c
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111

View file

@ -8223,7 +8223,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height) if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height)
unlock_height = td.m_tx.unlock_time; unlock_height = td.m_tx.unlock_time;
uint64_t blocks_to_unlock = unlock_height > approx_blockchain_height ? unlock_height - approx_blockchain_height : 0; uint64_t blocks_to_unlock = unlock_height > approx_blockchain_height ? unlock_height - approx_blockchain_height : 0;
size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0); size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0) + 288;
size_t start = req.outputs.size(); size_t start = req.outputs.size();
bool use_histogram = amount != 0 || !has_rct_distribution; bool use_histogram = amount != 0 || !has_rct_distribution;
@ -8544,7 +8544,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height) if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height)
unlock_height = td.m_tx.unlock_time; unlock_height = td.m_tx.unlock_time;
uint64_t blocks_to_unlock = unlock_height > approx_blockchain_height ? unlock_height - approx_blockchain_height : 0; uint64_t blocks_to_unlock = unlock_height > approx_blockchain_height ? unlock_height - approx_blockchain_height : 0;
size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0); size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0) + 288;
outs.push_back(std::vector<get_outs_entry>()); outs.push_back(std::vector<get_outs_entry>());
outs.back().reserve(fake_outputs_count + 1); outs.back().reserve(fake_outputs_count + 1);
const rct::key mask = td.is_rct() ? rct::commit(td.amount(), td.m_mask) : rct::zeroCommit(td.amount()); const rct::key mask = td.is_rct() ? rct::commit(td.amount(), td.m_mask) : rct::zeroCommit(td.amount());