revert requested_outputs_count

This commit is contained in:
wowario 2021-07-19 20:03:02 +03:00
parent 08aad7d135
commit 0c748617c4
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
1 changed files with 2 additions and 12 deletions

View File

@ -8672,12 +8672,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
const uint64_t amount = td.is_rct() ? 0 : td.amount(); const uint64_t amount = td.is_rct() ? 0 : td.amount();
std::unordered_set<uint64_t> seen_indices; std::unordered_set<uint64_t> seen_indices;
// request more for rct in base recent (locked) coinbases are picked, since they're locked for longer // request more for rct in base recent (locked) coinbases are picked, since they're locked for longer
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/311; size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW_V2 - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0);
uint64_t unlock_height = td.m_block_height + std::max<uint64_t>(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE, CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS);
if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height)
unlock_height = td.m_tx.unlock_time;
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) + 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;
@ -8993,12 +8988,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
for(size_t idx: selected_transfers) for(size_t idx: selected_transfers)
{ {
const transfer_details &td = m_transfers[idx]; const transfer_details &td = m_transfers[idx];
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/311; size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW_V2 - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0);
uint64_t unlock_height = td.m_block_height + std::max<uint64_t>(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE, CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS);
if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height)
unlock_height = td.m_tx.unlock_time;
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) + 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());