Skip to content

Commit 31b9736

Browse files
committed
Satisfy linter: added circular dependency, missing const, fixed usage of macros GUARDED_BY
1 parent d2e9e20 commit 31b9736

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/evo/assetlocktx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ maybe_error CAssetUnlockPayload::VerifySig(const uint256& msgHash, const CBlockI
132132
// TODO: update it after choosing proper consensus.llmqTypeAssetLocks (see comment there)
133133
const int count = 2;
134134
auto quorums = llmq::quorumManager->ScanQuorums(llmqType, pindexTip, count > -1 ? count : llmq_params.signingActiveQuorumCount);
135-
bool isActive = std::any_of(quorums.begin(), quorums.end(), [&](auto &q) { return q->qc->quorumHash == quorumHash; });
135+
bool isActive = std::any_of(quorums.begin(), quorums.end(), [&](const auto &q) { return q->qc->quorumHash == quorumHash; });
136136

137137
if (!isActive) {
138138
return {ValidationInvalidReason::CONSENSUS, "bad-assetunlock-not-active-quorum"};

src/evo/creditpool.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ static bool getAmountToUnlock(const CTransaction& tx, CAmount& toUnlock, int64_t
3939
return true;
4040
}
4141

42-
namespace {
43-
CCriticalSection cs_cache;
44-
45-
} // anonymous namespace
46-
4742
std::optional<CreditPoolCb> CCreditPoolManager::getFromCache(const uint256& block_hash, int height) {
4843
LOCK(cs_cache);
4944
CreditPoolCb pool{0, 0, {}};

src/evo/creditpool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ class CCreditPoolManager
110110
{
111111
private:
112112
static constexpr size_t CreditPoolCacheSize = 1000;
113-
unordered_lru_cache<uint256, CreditPoolCb, StaticSaltedHasher> creditPoolCache{CreditPoolCacheSize} GUARDED_BY(cs_cache);
113+
CCriticalSection cs_cache;
114+
unordered_lru_cache<uint256, CreditPoolCb, StaticSaltedHasher> creditPoolCache GUARDED_BY(cs_cache) {CreditPoolCacheSize};
114115

115116
CEvoDB& evoDb;
116117

test/lint/lint-circular-dependencies.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ EXPECTED_CIRCULAR_DEPENDENCIES=(
8181
"evo/specialtxman -> validation -> evo/specialtxman"
8282
"consensus/tx_verify -> evo/assetlocktx -> validation -> consensus/tx_verify"
8383
"consensus/tx_verify -> evo/assetlocktx -> llmq/quorums -> net_processing -> txmempool -> consensus/tx_verify"
84+
"evo/assetlocktx -> evo/creditpool -> evo/assetlocktx"
85+
"evo/assetlocktx -> llmq/quorums -> net_processing -> txmempool -> evo/assetlocktx"
8486

8587
"evo/simplifiedmns -> llmq/blockprocessor -> net_processing -> llmq/snapshot -> evo/simplifiedmns"
8688
"llmq/blockprocessor -> net_processing -> llmq/context -> llmq/blockprocessor"

0 commit comments

Comments
 (0)