Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 957 Lines • ▼ Show 20 Lines | uint64_t maxMempoolSize = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | ||||
// 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, | ||||
const std::string strHash, | |||||
double dPriorityDelta, | double dPriorityDelta, | ||||
const Amount nFeeDelta) { | const Amount nFeeDelta) { | ||||
{ | { | ||||
LOCK(cs); | LOCK(cs); | ||||
TXModifier &deltas = mapDeltas[hash]; | TXModifier &deltas = mapDeltas[hash]; | ||||
deltas.first += dPriorityDelta; | deltas.first += dPriorityDelta; | ||||
deltas.second += nFeeDelta; | deltas.second += nFeeDelta; | ||||
txiter it = mapTx.find(hash); | txiter it = mapTx.find(hash); | ||||
Show All 15 Lines | void CTxMemPool::PrioritiseTransaction(const uint256 &hash, | ||||
CalculateDescendants(it, setDescendants); | CalculateDescendants(it, setDescendants); | ||||
setDescendants.erase(it); | setDescendants.erase(it); | ||||
for (txiter descendantIt : setDescendants) { | for (txiter descendantIt : setDescendants) { | ||||
mapTx.modify(descendantIt, | mapTx.modify(descendantIt, | ||||
update_ancestor_state(0, 0, nFeeDelta, 0, 0)); | update_ancestor_state(0, 0, nFeeDelta, 0, 0)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, | LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", | ||||
dPriorityDelta, FormatMoney(nFeeDelta)); | hash.ToString(), dPriorityDelta, FormatMoney(nFeeDelta)); | ||||
} | } | ||||
void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, | void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, | ||||
Amount &nFeeDelta) const { | Amount &nFeeDelta) const { | ||||
LOCK(cs); | LOCK(cs); | ||||
std::map<uint256, TXModifier>::const_iterator pos = mapDeltas.find(hash); | std::map<uint256, TXModifier>::const_iterator pos = mapDeltas.find(hash); | ||||
if (pos == mapDeltas.end()) { | if (pos == mapDeltas.end()) { | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |