Mempool: Use Consensus::CheckTxInputs direclty over main::CheckInputs
This commit is contained in:
@@ -329,6 +329,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
|
||||
uint64_t innerUsage = 0;
|
||||
|
||||
CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins));
|
||||
const int64_t nSpendHeight = GetSpendHeight(mempoolDuplicate);
|
||||
|
||||
LOCK(cs);
|
||||
list<const CTxMemPoolEntry*> waitingOnDependants;
|
||||
@@ -383,7 +384,9 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
|
||||
waitingOnDependants.push_back(&(*it));
|
||||
else {
|
||||
CValidationState state;
|
||||
assert(ContextualCheckInputs(tx, state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
|
||||
bool fCheckResult = tx.IsCoinBase() ||
|
||||
Consensus::CheckTxInputs(tx, state, mempoolDuplicate, nSpendHeight, Params().GetConsensus());
|
||||
assert(fCheckResult);
|
||||
UpdateCoins(tx, mempoolDuplicate, 1000000);
|
||||
}
|
||||
}
|
||||
@@ -397,7 +400,9 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
|
||||
stepsSinceLastRemove++;
|
||||
assert(stepsSinceLastRemove < waitingOnDependants.size());
|
||||
} else {
|
||||
assert(ContextualCheckInputs(entry->GetTx(), state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
|
||||
bool fCheckResult = entry->GetTx().IsCoinBase() ||
|
||||
Consensus::CheckTxInputs(entry->GetTx(), state, mempoolDuplicate, nSpendHeight, Params().GetConsensus());
|
||||
assert(fCheckResult);
|
||||
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000);
|
||||
stepsSinceLastRemove = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user