Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 522 Lines • ▼ Show 20 Lines | |||||
// Calculates descendants of entry that are not already in setDescendants, and | // Calculates descendants of entry that are not already in setDescendants, and | ||||
// adds to setDescendants. Assumes entryit is already a tx in the mempool and | // adds to setDescendants. Assumes entryit is already a tx in the mempool and | ||||
// setMemPoolChildren is correct for tx and all descendants. Also assumes that | // setMemPoolChildren is correct for tx and all descendants. Also assumes that | ||||
// if an entry is in setDescendants already, then all in-mempool descendants of | // if an entry is in setDescendants already, then all in-mempool descendants of | ||||
// it are already in setDescendants as well, so that we can save time by not | // it are already in setDescendants as well, so that we can save time by not | ||||
// iterating over those entries. | // iterating over those entries. | ||||
void CTxMemPool::CalculateDescendants(txiter entryit, | void CTxMemPool::CalculateDescendants(txiter entryit, | ||||
setEntries &setDescendants) { | setEntries &setDescendants) const { | ||||
setEntries stage; | setEntries stage; | ||||
if (setDescendants.count(entryit) == 0) { | if (setDescendants.count(entryit) == 0) { | ||||
stage.insert(entryit); | stage.insert(entryit); | ||||
} | } | ||||
// Traverse down the children of entry, only adding children that are not | // Traverse down the children of entry, only adding children that are not | ||||
// accounted for in setDescendants already (because those children have | // accounted for in setDescendants already (because those children have | ||||
// either already been walked, or will be walked in this iteration). | // either already been walked, or will be walked in this iteration). | ||||
while (!stage.empty()) { | while (!stage.empty()) { | ||||
▲ Show 20 Lines • Show All 865 Lines • Show Last 20 Lines |