Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 787 Lines • ▼ Show 20 Lines | for (indexed_transaction_set::const_iterator it = mapTx.begin(); | ||||
if (fDependsWait) { | if (fDependsWait) { | ||||
waitingOnDependants.push_back(&(*it)); | waitingOnDependants.push_back(&(*it)); | ||||
} else { | } else { | ||||
CValidationState state; | CValidationState state; | ||||
bool fCheckResult = tx.IsCoinBase() || | bool fCheckResult = tx.IsCoinBase() || | ||||
Consensus::CheckTxInputs( | Consensus::CheckTxInputs( | ||||
tx, state, mempoolDuplicate, nSpendHeight); | tx, state, mempoolDuplicate, nSpendHeight); | ||||
assert(fCheckResult); | assert(fCheckResult); | ||||
UpdateCoins(tx, mempoolDuplicate, 1000000); | UpdateCoins(mempoolDuplicate, tx, 1000000); | ||||
} | } | ||||
} | } | ||||
unsigned int stepsSinceLastRemove = 0; | unsigned int stepsSinceLastRemove = 0; | ||||
while (!waitingOnDependants.empty()) { | while (!waitingOnDependants.empty()) { | ||||
const CTxMemPoolEntry *entry = waitingOnDependants.front(); | const CTxMemPoolEntry *entry = waitingOnDependants.front(); | ||||
waitingOnDependants.pop_front(); | waitingOnDependants.pop_front(); | ||||
CValidationState state; | CValidationState state; | ||||
if (!mempoolDuplicate.HaveInputs(entry->GetTx())) { | if (!mempoolDuplicate.HaveInputs(entry->GetTx())) { | ||||
waitingOnDependants.push_back(entry); | waitingOnDependants.push_back(entry); | ||||
stepsSinceLastRemove++; | stepsSinceLastRemove++; | ||||
assert(stepsSinceLastRemove < waitingOnDependants.size()); | assert(stepsSinceLastRemove < waitingOnDependants.size()); | ||||
} else { | } else { | ||||
bool fCheckResult = | bool fCheckResult = | ||||
entry->GetTx().IsCoinBase() || | entry->GetTx().IsCoinBase() || | ||||
Consensus::CheckTxInputs(entry->GetTx(), state, | Consensus::CheckTxInputs(entry->GetTx(), state, | ||||
mempoolDuplicate, nSpendHeight); | mempoolDuplicate, nSpendHeight); | ||||
assert(fCheckResult); | assert(fCheckResult); | ||||
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000); | UpdateCoins(mempoolDuplicate, entry->GetTx(), 1000000); | ||||
stepsSinceLastRemove = 0; | stepsSinceLastRemove = 0; | ||||
} | } | ||||
} | } | ||||
for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) { | for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) { | ||||
uint256 txid = it->second->GetId(); | uint256 txid = it->second->GetId(); | ||||
indexed_transaction_set::const_iterator it2 = mapTx.find(txid); | indexed_transaction_set::const_iterator it2 = mapTx.find(txid); | ||||
const CTransaction &tx = it2->GetTx(); | const CTransaction &tx = it2->GetTx(); | ||||
▲ Show 20 Lines • Show All 431 Lines • Show Last 20 Lines |