mirror of https://github.com/SChernykh/p2pool
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/238/head
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));
|
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;
|
size_t total_mempool_transactions;
|
||||||
{
|
{
|
||||||
m_mempoolTxs.clear();
|
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();
|
const uint64_t cur_time = seconds_since_epoch();
|
||||||
|
|
||||||
for (auto& it : mempool.m_transactions) {
|
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);
|
m_mempoolTxs.emplace_back(it.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1162,9 +1162,9 @@ void P2PServer::check_block_template()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force update block template every 30 seconds after the initial sync is done
|
// Force update block template every 20 seconds after the initial sync is done
|
||||||
if (seconds_since_epoch() >= m_pool->block_template().last_updated() + 30) {
|
if (seconds_since_epoch() >= m_pool->block_template().last_updated() + 20) {
|
||||||
LOGINFO(4, "block template is 30 seconds old, updating it");
|
LOGINFO(4, "block template is 20 seconds old, updating it");
|
||||||
m_pool->update_block_template_async();
|
m_pool->update_block_template_async();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue