Reduced transaction time-to-include delay

Based on data from https://rucknium.me/posts/monero-pool-transaction-delay/
> 95 percent all transactions arrived at all five Monero nodes within a five-second interval.
pull/1/head
SChernykh 1 year ago
parent 85d177d394
commit 595196b5ec

@ -325,7 +325,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, Wallet
parallel_run(uv_default_loop_checked(), Precalc(m_shares, m_poolBlockTemplate->m_txkeySec));
}
// Only choose transactions that were received 10 or more seconds ago, or high fee (>= 0.006 XMR) transactions
// Only choose transactions that were received 5 or more seconds ago, or high fee (>= 0.006 XMR) transactions
size_t total_mempool_transactions;
{
m_mempoolTxs.clear();
@ -337,7 +337,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, Wallet
const uint64_t cur_time = seconds_since_epoch();
for (auto& it : mempool.m_transactions) {
if ((cur_time >= it.second.time_received + 10) || (it.second.fee >= HIGH_FEE_VALUE)) {
if ((cur_time > it.second.time_received + 5) || (it.second.fee >= HIGH_FEE_VALUE)) {
m_mempoolTxs.emplace_back(it.second);
}
}

@ -1162,9 +1162,9 @@ void P2PServer::check_block_template()
return;
}
// Force update block template every 30 seconds after the initial sync is done
if (seconds_since_epoch() >= m_pool->block_template().last_updated() + 30) {
LOGINFO(4, "block template is 30 seconds old, updating it");
// Force update block template every 20 seconds after the initial sync is done
if (seconds_since_epoch() >= m_pool->block_template().last_updated() + 20) {
LOGINFO(4, "block template is 20 seconds old, updating it");
m_pool->update_block_template_async();
}
}

Loading…
Cancel
Save