aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-07-28 20:15:46 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2015-07-28 20:15:51 +0200
commit5c27f1247a23f24c81eda8b0c90d48923edf7792 (patch)
treef895f77f46d5ccb686f72b2d57f2fe5252631a71 /src/main.cpp
parentbc484ef8db02715e283e4cddd2c972316c0688dd (diff)
downloadbitcoin-5c27f1247a23f24c81eda8b0c90d48923edf7792.tar.xz
Revert "Cache transaction validation successes"
This reverts commit bc484ef8db02715e283e4cddd2c972316c0688dd.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 790eb4ff15..8f82abf4d9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1397,24 +1397,10 @@ bool CScriptCheck::operator()() {
return true;
}
-static mrumap<uint256, unsigned int> cacheCheck(2 * MAX_BLOCK_SIZE / CTransaction().GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION));
-static boost::mutex cs_cacheCheck;
-
bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheStore, std::vector<CScriptCheck> *pvChecks)
{
if (!tx.IsCoinBase())
{
- if (fScriptChecks) {
- boost::unique_lock<boost::mutex> lock(cs_cacheCheck);
- mrumap<uint256, unsigned int>::const_iterator iter = cacheCheck.find(tx.GetHash());
- if (iter != cacheCheck.end()) {
- // The following test relies on the fact that all script validation flags are softforks (i.e. an extra bit set cannot cause a false result to become true).
- if ((iter->second & flags) == flags) {
- return true;
- }
- }
- }
-
if (pvChecks)
pvChecks->reserve(tx.vin.size());
@@ -1510,11 +1496,6 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
}
}
- if (cacheStore && fScriptChecks && pvChecks == NULL) {
- boost::unique_lock<boost::mutex> lock(cs_cacheCheck);
- cacheCheck.insert(tx.GetHash(), flags);
- }
-
return true;
}
@@ -2229,13 +2210,6 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
BOOST_FOREACH(const CTransaction &tx, pblock->vtx) {
SyncWithWallets(tx, pblock);
}
- // Erase block's transactions from the validation cache
- {
- boost::unique_lock<boost::mutex> lock(cs_cacheCheck);
- BOOST_FOREACH(const CTransaction &tx, pblock->vtx) {
- cacheCheck.erase(tx.GetHash());
- }
- }
int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;
LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001);