Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | |||||
* addPackageTx includes transactions paying a fee by ensuring that | * addPackageTx includes transactions paying a fee by ensuring that | ||||
* the partial ordering of transactions is maintained. That is to say | * the partial ordering of transactions is maintained. That is to say | ||||
* children come after parents, despite having a potentially larger fee. | * children come after parents, despite having a potentially larger fee. | ||||
* @param[out] nPackagesSelected How many packages were selected | * @param[out] nPackagesSelected How many packages were selected | ||||
* @param[out] nDescendantsUpdated Number of descendant transactions updated | * @param[out] nDescendantsUpdated Number of descendant transactions updated | ||||
*/ | */ | ||||
void BlockAssembler::addPackageTxs(int &nPackagesSelected, | void BlockAssembler::addPackageTxs(int &nPackagesSelected, | ||||
int &nDescendantsUpdated) { | int &nDescendantsUpdated) { | ||||
// selection algorithm orders the mempool based on feerate of a | // selection algorithm orders the mempool based on feerate of a | ||||
// transaction including all unconfirmed ancestors. Since we don't remove | // transaction including all unconfirmed ancestors. Since we don't remove | ||||
// transactions from the mempool as we select them for block inclusion, we | // transactions from the mempool as we select them for block inclusion, we | ||||
// need an alternate method of updating the feerate of a transaction with | // need an alternate method of updating the feerate of a transaction with | ||||
// its not-yet-selected ancestors as we go. This is accomplished by | // its not-yet-selected ancestors as we go. This is accomplished by | ||||
// walking the in-mempool descendants of selected transactions and storing | // walking the in-mempool descendants of selected transactions and storing | ||||
// a temporary modified state in mapModifiedTxs. Each time through the | // a temporary modified state in mapModifiedTxs. Each time through the | ||||
// loop, we compare the best transaction in mapModifiedTxs with the next | // loop, we compare the best transaction in mapModifiedTxs with the next | ||||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |