mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-05 22:44:50 +02:00
validation: CVerifyDB::VerifyDB: Use locking annotation
...instead of recursively locking unconditionally
This commit is contained in:
parent
03f75c42e1
commit
e11b649650
@ -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 New Issue
Block a user