Skip to content

Commit 2039a8d

Browse files
committed
refactor: remove Internal*() function definitions, consolidate
1 parent ebfd683 commit 2039a8d

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/chainlocks/chainlocks.cpp

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

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

385-
bool CChainLocksHandler::InternalHasChainLock(int nHeight, const uint256& blockHash) const
379+
bool CChainLocksHandler::HasChainLock(int nHeight, const uint256& blockHash) const
386380
{
387-
AssertLockHeld(cs);
381+
AssertLockNotHeld(cs);
382+
LOCK(cs);
388383

389384
if (!IsEnabled()) {
390385
return false;
@@ -408,13 +403,8 @@ bool CChainLocksHandler::InternalHasChainLock(int nHeight, const uint256& blockH
408403

409404
bool CChainLocksHandler::HasConflictingChainLock(int nHeight, const uint256& blockHash) const
410405
{
406+
AssertLockNotHeld(cs);
411407
LOCK(cs);
412-
return InternalHasConflictingChainLock(nHeight, blockHash);
413-
}
414-
415-
bool CChainLocksHandler::InternalHasConflictingChainLock(int nHeight, const uint256& blockHash) const
416-
{
417-
AssertLockHeld(cs);
418408

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

src/chainlocks/chainlocks.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)