aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-08-01 00:05:02 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-08-01 00:09:14 +0200
commitf798b891bcecea9548eedacae70eeb9906c1ddbf (patch)
treecb888e5b25611578736e4c8a1a871b3228bdcd0a /src/txmempool.cpp
parentcf2cecb18779ce83de9adebf382dff1c19b12840 (diff)
parenta6cc299541fc9df5af010ce63eb1dd34d8c4b6e2 (diff)
downloadbitcoin-f798b891bcecea9548eedacae70eeb9906c1ddbf.tar.xz
Merge #8346: Mempool: Use Consensus::CheckTxInputs direclty over main::CheckInputs
a6cc299 Mempool: Use Consensus::CheckTxInputs direclty over main::CheckInputs (Jorge Timón)
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 82827b8e4f..b631c48484 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -657,6 +657,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;
@@ -737,7 +738,9 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
waitingOnDependants.push_back(&(*it));
else {
CValidationState state;
- assert(CheckInputs(tx, state, mempoolDuplicate, false, 0, false, NULL));
+ bool fCheckResult = tx.IsCoinBase() ||
+ Consensus::CheckTxInputs(tx, state, mempoolDuplicate, nSpendHeight);
+ assert(fCheckResult);
UpdateCoins(tx, mempoolDuplicate, 1000000);
}
}
@@ -751,7 +754,9 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
stepsSinceLastRemove++;
assert(stepsSinceLastRemove < waitingOnDependants.size());
} else {
- assert(CheckInputs(entry->GetTx(), state, mempoolDuplicate, false, 0, false, NULL));
+ bool fCheckResult = entry->GetTx().IsCoinBase() ||
+ Consensus::CheckTxInputs(entry->GetTx(), state, mempoolDuplicate, nSpendHeight);
+ assert(fCheckResult);
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000);
stepsSinceLastRemove = 0;
}