Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 578 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); | ||||
} | } | ||||
} | } | ||||
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. | |||||
if (nBlockPriorityPercentage == 0) { | if (nBlockPriorityPercentage == 0) { | ||||
return; | return; | ||||
} | } | ||||
uint64_t nBlockPrioritySize = | uint64_t nBlockPrioritySize = | ||||
nMaxGeneratedBlockSize * nBlockPriorityPercentage / 100; | nMaxGeneratedBlockSize * nBlockPriorityPercentage / 100; | ||||
// This vector will be sorted into a priority queue: | // This vector will be sorted into a priority queue: | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | while (!vecPriority.empty()) { | ||||
AddToBlock(iter); | AddToBlock(iter); | ||||
// If now that this txs is added we've surpassed our desired priority | // If now that this txs is added we've surpassed our desired priority | ||||
// size, then we're done adding priority transactions. | // size, then we're done adding priority transactions. | ||||
if (nBlockSize >= nBlockPrioritySize) { | if (nBlockSize >= nBlockPrioritySize) { | ||||
break; | break; | ||||
} | } | ||||
// if we have dropped below the AllowFreeThreshold, then we're done | |||||
// adding priority transactions. | |||||
if (!AllowFree(actualPriority)) { | |||||
break; | |||||
} | |||||
// This tx was successfully added, so add transactions that depend | // This tx was successfully added, so add transactions that depend | ||||
// on this one to the priority queue to try again. | // on this one to the priority queue to try again. | ||||
for (CTxMemPool::txiter child : mempool->GetMemPoolChildren(iter)) { | for (CTxMemPool::txiter child : mempool->GetMemPoolChildren(iter)) { | ||||
waitPriIter wpiter = waitPriMap.find(child); | waitPriIter wpiter = waitPriMap.find(child); | ||||
if (wpiter == waitPriMap.end()) { | if (wpiter == waitPriMap.end()) { | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |