Skip to content

Commit 5b441a0

Browse files
committed
DONOTMERGE checking if I can move the lock down and have tests pass
1 parent 22d8759 commit 5b441a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,6 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
19501950
uint256 hashCacheEntry;
19511951
CSHA256 hasher = g_scriptExecutionCacheHasher;
19521952
hasher.Write(UCharCast(tx.GetWitnessHash().begin()), 32).Write((unsigned char*)&flags, sizeof(flags)).Finalize(hashCacheEntry.begin());
1953-
AssertLockHeld(cs_main); //TODO: Remove this requirement by making CuckooCache not require external locks
19541953
if (g_scriptExecutionCache.contains(hashCacheEntry, !cacheFullScriptStore)) {
19551954
return true;
19561955
}
@@ -2012,6 +2011,7 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
20122011
if (cacheFullScriptStore && !pvChecks) {
20132012
// We executed all of the provided scripts, and were told to
20142013
// cache the result. Do so now.
2014+
AssertLockHeld(cs_main); //TODO: Remove this requirement by making CuckooCache not require external locks
20152015
g_scriptExecutionCache.insert(hashCacheEntry);
20162016
}
20172017

0 commit comments

Comments
 (0)