Skip to content

Commit 733f7d3

Browse files
committed
refactor: remove Internal*() function definitions, consolidate
1 parent e742b7b commit 733f7d3

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/chainlock/chainlock.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,6 @@ void CChainLocksHandler::EnforceBestChainLock()
367367
::g_stats_client->gauge("chainlocks.blockHeight", clsig->getHeight(), 1.0f);
368368
}
369369

370-
bool CChainLocksHandler::HasChainLock(int nHeight, const uint256& blockHash) const
371-
{
372-
LOCK(cs);
373-
return InternalHasChainLock(nHeight, blockHash);
374-
}
375-
376370
VerifyRecSigStatus CChainLocksHandler::VerifyChainLock(const chainlock::ChainLockSig& clsig) const
377371
{
378372
const auto llmqType = Params().GetConsensus().llmqTypeChainLocks;
@@ -381,9 +375,10 @@ VerifyRecSigStatus CChainLocksHandler::VerifyChainLock(const chainlock::ChainLoc
381375
return llmq::VerifyRecoveredSig(llmqType, m_chainstate.m_chain, qman, clsig.getHeight(), nRequestId, clsig.getBlockHash(), clsig.getSig());
382376
}
383377

384-
bool CChainLocksHandler::InternalHasChainLock(int nHeight, const uint256& blockHash) const
378+
bool CChainLocksHandler::HasChainLock(int nHeight, const uint256& blockHash) const
385379
{
386-
AssertLockHeld(cs);
380+
AssertLockNotHeld(cs);
381+
LOCK(cs);
387382

388383
if (!IsEnabled()) {
389384
return false;
@@ -407,13 +402,8 @@ bool CChainLocksHandler::InternalHasChainLock(int nHeight, const uint256& blockH
407402

408403
bool CChainLocksHandler::HasConflictingChainLock(int nHeight, const uint256& blockHash) const
409404
{
405+
AssertLockNotHeld(cs);
410406
LOCK(cs);
411-
return InternalHasConflictingChainLock(nHeight, blockHash);
412-
}
413-
414-
bool CChainLocksHandler::InternalHasConflictingChainLock(int nHeight, const uint256& blockHash) const
415-
{
416-
AssertLockHeld(cs);
417407

418408
if (!IsEnabled()) {
419409
return false;

src/chainlock/chainlock.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ class CChainLocksHandler
103103
[[nodiscard]] bool IsEnabled() const { return isEnabled; }
104104

105105
private:
106-
// these require locks to be held already
107-
bool InternalHasChainLock(int nHeight, const uint256& blockHash) const EXCLUSIVE_LOCKS_REQUIRED(cs);
108-
bool InternalHasConflictingChainLock(int nHeight, const uint256& blockHash) const EXCLUSIVE_LOCKS_REQUIRED(cs);
109-
110106
void Cleanup() EXCLUSIVE_LOCKS_REQUIRED(!cs);
111107
};
112108

0 commit comments

Comments
 (0)