Skip to content

Commit ad5f01b

Browse files
committed
[validation] Move the lock annotation from function definition to declaration
When the annotation is on the definition, it does not check call sites between the declaration and the definition.
1 parent 92fee79 commit ad5f01b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/test/txvalidationcache_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <boost/test/unit_test.hpp>
1515

16-
bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks);
16+
bool CheckInputScripts(const CTransaction& tx, TxValidationState& state, const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck>* pvChecks) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
1717

1818
BOOST_AUTO_TEST_SUITE(txvalidationcache_tests)
1919

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ CBlockIndex* BlockManager::FindForkInGlobalIndex(const CChain& chain, const CBlo
198198

199199
std::unique_ptr<CBlockTreeDB> pblocktree;
200200

201-
bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks = nullptr);
201+
bool CheckInputScripts(const CTransaction& tx, TxValidationState& state, const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck>* pvChecks = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
202202
static FILE* OpenUndoFile(const FlatFilePos &pos, bool fReadOnly = false);
203203
static FlatFileSeq BlockFileSeq();
204204
static FlatFileSeq UndoFileSeq();
@@ -1450,7 +1450,7 @@ void InitScriptExecutionCache() {
14501450
*
14511451
* Non-static (and re-declared) in src/test/txvalidationcache_tests.cpp
14521452
*/
1453-
bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1453+
bool CheckInputScripts(const CTransaction& tx, TxValidationState& state, const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck>* pvChecks)
14541454
{
14551455
if (tx.IsCoinBase()) return true;
14561456

0 commit comments

Comments
 (0)