Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 948 Lines • ▼ Show 20 Lines | TxMempoolInfo CTxMemPool::info(const uint256 &txid) const { | ||||
return GetInfo(i); | return GetInfo(i); | ||||
} | } | ||||
CFeeRate CTxMemPool::estimateFee(int nBlocks) const { | CFeeRate CTxMemPool::estimateFee(int nBlocks) const { | ||||
LOCK(cs); | LOCK(cs); | ||||
uint64_t maxMempoolSize = | uint64_t maxMempoolSize = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); | ||||
// minerPolicy uses recent blocks to figure out a reasonable fee. This | // minerPolicy uses recent blocks to figure out a reasonable fee. This | ||||
// may disagree with the rollingMinimumFeerate under certain scenarios | // may disagree with the rollingMinimumFeerate under certain scenarios | ||||
// where the mempool increases rapidly, or blocks are being mined which | // where the mempool increases rapidly, or blocks are being mined which | ||||
// do not contain propagated transactions. | // do not contain propagated transactions. | ||||
return std::max(GetConfig().GetMinFeePerKB(), GetMinFee(maxMempoolSize)); | return std::max(GetConfig().GetMinFeePerKB(), GetMinFee(maxMempoolSize)); | ||||
} | } | ||||
void CTxMemPool::PrioritiseTransaction(const uint256 hash, | void CTxMemPool::PrioritiseTransaction(const uint256 hash, | ||||
▲ Show 20 Lines • Show All 418 Lines • ▼ Show 20 Lines | void DisconnectedBlockTransactions::updateMempoolForReorg(const Config &config, | ||||
g_mempool.UpdateTransactionsFromBlock(txidsUpdate); | g_mempool.UpdateTransactionsFromBlock(txidsUpdate); | ||||
// We also need to remove any now-immature transactions | // We also need to remove any now-immature transactions | ||||
g_mempool.removeForReorg(config, pcoinsTip.get(), | g_mempool.removeForReorg(config, pcoinsTip.get(), | ||||
chainActive.Tip()->nHeight + 1, | chainActive.Tip()->nHeight + 1, | ||||
STANDARD_LOCKTIME_VERIFY_FLAGS); | STANDARD_LOCKTIME_VERIFY_FLAGS); | ||||
// Re-limit mempool size, in case we added any transactions | // Re-limit mempool size, in case we added any transactions | ||||
g_mempool.LimitSize( | g_mempool.LimitSize(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE), | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, | gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * | ||||
gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); | 60 * 60); | ||||
} | } |