Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 585 Lines • ▼ Show 20 Lines | while (mi != mempool->mapTx.get<ancestor_score>().end() || | ||||
++nPackagesSelected; | ++nPackagesSelected; | ||||
// Update transactions that depend on each of these | // Update transactions that depend on each of these | ||||
nDescendantsUpdated += UpdatePackagesForAdded(ancestors, mapModifiedTx); | nDescendantsUpdated += UpdatePackagesForAdded(ancestors, mapModifiedTx); | ||||
} | } | ||||
} | } | ||||
// We want to sort transactions by coin age priority | |||||
typedef std::pair<double, CTxMemPool::txiter> TxCoinAgePriority; | |||||
struct TxCoinAgePriorityCompare { | |||||
bool operator()(const TxCoinAgePriority &a, const TxCoinAgePriority &b) { | |||||
if (a.first == b.first) { | |||||
// Reverse order to make sort less than | |||||
return CompareTxMemPoolEntryByScore()(*(b.second), *(a.second)); | |||||
} | |||||
return a.first < b.first; | |||||
} | |||||
}; | |||||
void BlockAssembler::addPriorityTxs() { | void BlockAssembler::addPriorityTxs() { | ||||
// How much of the block should be dedicated to high-priority transactions, | // How much of the block should be dedicated to high-priority transactions, | ||||
// included regardless of the fees they pay. | // included regardless of the fees they pay. | ||||
if (config->GetBlockPriorityPercentage() == 0) { | if (config->GetBlockPriorityPercentage() == 0) { | ||||
return; | return; | ||||
} | } | ||||
uint64_t nBlockPrioritySize = | uint64_t nBlockPrioritySize = | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |