mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
validation: CVerifyDB::VerifyDB: Use locking annotation
...instead of recursively locking unconditionally
This commit is contained in:
parent
03f75c42e1
commit
e11b649650
2 changed files with 3 additions and 2 deletions
|
@ -4245,7 +4245,8 @@ CVerifyDB::~CVerifyDB()
|
|||
|
||||
bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CChainState& active_chainstate, CCoinsView *coinsview, int nCheckLevel, int nCheckDepth)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
|
||||
if (active_chainstate.m_chain.Tip() == nullptr || active_chainstate.m_chain.Tip()->pprev == nullptr)
|
||||
return true;
|
||||
|
|
|
@ -340,7 +340,7 @@ class CVerifyDB {
|
|||
public:
|
||||
CVerifyDB();
|
||||
~CVerifyDB();
|
||||
bool VerifyDB(const CChainParams& chainparams, CChainState& active_chainstate, CCoinsView *coinsview, int nCheckLevel, int nCheckDepth);
|
||||
bool VerifyDB(const CChainParams& chainparams, CChainState& active_chainstate, CCoinsView *coinsview, int nCheckLevel, int nCheckDepth) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
};
|
||||
|
||||
enum DisconnectResult
|
||||
|
|
Loading…
Reference in a new issue