Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 721 Lines • ▼ Show 20 Lines | for (indexed_transaction_set::const_iterator it = mapTx.begin(); | ||||
const CTransaction &tx = it->GetTx(); | const CTransaction &tx = it->GetTx(); | ||||
txlinksMap::const_iterator linksiter = mapLinks.find(it); | txlinksMap::const_iterator linksiter = mapLinks.find(it); | ||||
assert(linksiter != mapLinks.end()); | assert(linksiter != mapLinks.end()); | ||||
const TxLinks &links = linksiter->second; | const TxLinks &links = linksiter->second; | ||||
innerUsage += memusage::DynamicUsage(links.parents) + | innerUsage += memusage::DynamicUsage(links.parents) + | ||||
memusage::DynamicUsage(links.children); | memusage::DynamicUsage(links.children); | ||||
bool fDependsWait = false; | bool fDependsWait = false; | ||||
setEntries setParentCheck; | setEntries setParentCheck; | ||||
int64_t parentSizes = 0; | |||||
int64_t parentSigOpCount = 0; | |||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
// Check that every mempool transaction's inputs refer to available | // Check that every mempool transaction's inputs refer to available | ||||
// coins, or other mempool tx's. | // coins, or other mempool tx's. | ||||
indexed_transaction_set::const_iterator it2 = | indexed_transaction_set::const_iterator it2 = | ||||
mapTx.find(txin.prevout.GetTxId()); | mapTx.find(txin.prevout.GetTxId()); | ||||
if (it2 != mapTx.end()) { | if (it2 != mapTx.end()) { | ||||
const CTransaction &tx2 = it2->GetTx(); | const CTransaction &tx2 = it2->GetTx(); | ||||
assert(tx2.vout.size() > txin.prevout.GetN() && | assert(tx2.vout.size() > txin.prevout.GetN() && | ||||
!tx2.vout[txin.prevout.GetN()].IsNull()); | !tx2.vout[txin.prevout.GetN()].IsNull()); | ||||
fDependsWait = true; | fDependsWait = true; | ||||
if (setParentCheck.insert(it2).second) { | setParentCheck.insert(it2); | ||||
parentSizes += it2->GetTxSize(); | |||||
parentSigOpCount += it2->GetSigOpCount(); | |||||
} | |||||
} else { | } else { | ||||
assert(pcoins->HaveCoin(txin.prevout)); | assert(pcoins->HaveCoin(txin.prevout)); | ||||
} | } | ||||
// Check whether its inputs are marked in mapNextTx. | // Check whether its inputs are marked in mapNextTx. | ||||
auto it3 = mapNextTx.find(txin.prevout); | auto it3 = mapNextTx.find(txin.prevout); | ||||
assert(it3 != mapNextTx.end()); | assert(it3 != mapNextTx.end()); | ||||
assert(it3->first == &txin.prevout); | assert(it3->first == &txin.prevout); | ||||
assert(it3->second == &tx); | assert(it3->second == &tx); | ||||
▲ Show 20 Lines • Show All 644 Lines • Show Last 20 Lines |