mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-09 20:30:05 +00:00
Add high fee transactions immediately
This commit is contained in:
parent
260564cff1
commit
baf5a64c51
3 changed files with 9 additions and 2 deletions
|
@ -260,7 +260,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, Wallet
|
||||||
|
|
||||||
m_sidechain->fill_sidechain_data(*m_poolBlockTemplate, miner_wallet, m_txkeySec, m_shares);
|
m_sidechain->fill_sidechain_data(*m_poolBlockTemplate, miner_wallet, m_txkeySec, m_shares);
|
||||||
|
|
||||||
// Only choose transactions that were received 10 or more seconds ago
|
// Only choose transactions that were received 10 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();
|
||||||
|
@ -272,7 +272,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) {
|
if ((cur_time >= it.second.time_received + 10) || (it.second.fee >= HIGH_FEE_VALUE)) {
|
||||||
m_mempoolTxs.emplace_back(it.second);
|
m_mempoolTxs.emplace_back(it.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
namespace p2pool {
|
namespace p2pool {
|
||||||
|
|
||||||
|
constexpr uint64_t HIGH_FEE_VALUE = 6000000000ULL;
|
||||||
|
|
||||||
class p2pool;
|
class p2pool;
|
||||||
|
|
||||||
class Mempool : public nocopy_nomove
|
class Mempool : public nocopy_nomove
|
||||||
|
|
|
@ -244,6 +244,11 @@ void p2pool::handle_tx(TxMempoolData& tx)
|
||||||
", weight = " << log::Gray() << tx.weight << log::NoColor() <<
|
", weight = " << log::Gray() << tx.weight << log::NoColor() <<
|
||||||
", fee = " << log::Gray() << static_cast<double>(tx.fee) / 1e6 << " um");
|
", fee = " << log::Gray() << static_cast<double>(tx.fee) / 1e6 << " um");
|
||||||
|
|
||||||
|
if (tx.fee >= HIGH_FEE_VALUE) {
|
||||||
|
LOGINFO(4, "high fee tx received: " << log::LightBlue() << tx.id << log::NoColor() << ", " << log::XMRAmount(tx.fee) << " - updating block template");
|
||||||
|
update_block_template_async();
|
||||||
|
}
|
||||||
|
|
||||||
#if TEST_MEMPOOL_PICKING_ALGORITHM
|
#if TEST_MEMPOOL_PICKING_ALGORITHM
|
||||||
m_blockTemplate->update(miner_data(), *m_mempool, &m_params->m_wallet);
|
m_blockTemplate->update(miner_data(), *m_mempool, &m_params->m_wallet);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue