skip balance checks when assumevalid is active

This commit is contained in:
Gregory Sanders 2017-12-11 11:00:55 -05:00
parent 93cabbf1e9
commit 2ccbf87b04
4 changed files with 12 additions and 10 deletions

View file

@ -764,7 +764,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
CValidationState state;
std::set<std::pair<uint256, COutPoint> > setPeginsSpent;
bool fCheckResult = tx.IsCoinBase() ||
Consensus::CheckTxInputs(tx, state, mempoolDuplicate, nSpendHeight, setPeginsSpent, NULL, false);
Consensus::CheckTxInputs(tx, state, mempoolDuplicate, nSpendHeight, setPeginsSpent, NULL, false, true);
assert(fCheckResult);
UpdateCoins(tx, mempoolDuplicate, 1000000);
assert(setPeginsSpent == it->setPeginsSpent);
@ -785,7 +785,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
} else {
std::set<std::pair<uint256, COutPoint> > setPeginsSpent;
bool fCheckResult = entry->GetTx().IsCoinBase() ||
Consensus::CheckTxInputs(entry->GetTx(), state, mempoolDuplicate, nSpendHeight, setPeginsSpent, NULL, false);
Consensus::CheckTxInputs(entry->GetTx(), state, mempoolDuplicate, nSpendHeight, setPeginsSpent, NULL, false, true);
assert(fCheckResult);
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000);
assert(setPeginsSpent == entry->setPeginsSpent);