Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/containers/ci/ci-slim.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Builder for cppcheck
FROM debian:bookworm-slim AS cppcheck-builder
ARG CPPCHECK_VERSION=2.17.1
ARG CPPCHECK_VERSION=2.21.0
RUN set -ex; \
apt-get update && apt-get install -y --no-install-recommends \
curl \
Expand Down
2 changes: 1 addition & 1 deletion src/active/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ActiveContext::ActiveContext(CBLSWorker& bls_worker, ChainstateManager& chainman
dkgdbgman{std::make_unique<llmq::CDKGDebugManager>(dmnman, qsnapman, chainman)},
qdkgsman{std::make_unique<llmq::CDKGSessionManager>(dmnman, qsnapman, chainman, sporkman, db_params)},
shareman{std::make_unique<llmq::CSigSharesManager>(connman, chainman, sigman, *nodeman, qman, sporkman)},
gov_signer{std::make_unique<GovernanceSigner>(connman, dmnman, govman, superblocks, *nodeman, chainman, mn_sync)},
gov_signer{std::make_unique<GovernanceSigner>(dmnman, govman, superblocks, *nodeman, chainman, mn_sync)},
ehf_sighandler{std::make_unique<llmq::CEHFSignalsHandler>(chainman, sigman, *shareman, qman)},
cl_signer{std::make_unique<chainlock::ChainLockSigner>(chainman, chainlocks, clhandler, isman,
qman, sigman, *shareman, mn_sync)},
Expand Down
2 changes: 1 addition & 1 deletion src/active/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct ActiveContext final : public llmq::QuorumRole, public CValidationInterfac
llmq::CQuorumManager& qman, llmq::CQuorumSnapshotManager& qsnapman,
llmq::CSigningManager& sigman, const CMasternodeSync& mn_sync,
const CBLSSecretKey& operator_sk, const util::DbWrapperParams& db_params, bool quorums_watch);
~ActiveContext();
~ActiveContext() override;

void Start();
void Stop();
Expand Down
3 changes: 0 additions & 3 deletions src/active/dkgsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,6 @@ CFinalCommitment ActiveDKGSession::FinalizeSingleCommitment()

CDKGLogger logger(*this, __func__, __LINE__);

std::vector<CBLSId> signerIds;
std::vector<CBLSSignature> thresholdSigs;

CFinalCommitment fqc(params, m_quorum_base_block_index->GetBlockHash());


Expand Down
2 changes: 1 addition & 1 deletion src/active/dkgsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ActiveDKGSession final : public llmq::CDKGSession
const CActiveMasternodeManager& mn_activeman, const ChainstateManager& chainman,
const CSporkManager& sporkman, const CBlockIndex* base_block_index,
const Consensus::LLMQParams& params);
~ActiveDKGSession();
~ActiveDKGSession() override;

public:
// Phase 1: contribution
Expand Down
2 changes: 1 addition & 1 deletion src/active/dkgsessionhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ActiveDKGSessionHandler final : public llmq::CDKGSessionHandler
const CActiveMasternodeManager& mn_activeman, const ChainstateManager& chainman,
const CSporkManager& sporkman, const Consensus::LLMQParams& llmq_params, bool quorums_watch,
int quorums_idx);
~ActiveDKGSessionHandler();
~ActiveDKGSessionHandler() override;

public:
//! CDKGSessionHandler
Expand Down
3 changes: 3 additions & 0 deletions src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class CBLSWrapper
return IsValid();
}

// cppcheck-suppress functionStatic
inline void Serialize(CSizeComputer& s) const
{
s.seek(SerSize);
Expand Down Expand Up @@ -234,6 +235,7 @@ class CBLSWrapper
struct CBLSIdImplicit : public uint256
{
CBLSIdImplicit() = default;
// cppcheck-suppress noExplicitConstructor
CBLSIdImplicit(const uint256& id)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't add explicit here? any good reason for it?
Fix is trivial:

diff --git a/src/bls/bls.cpp b/src/bls/bls.cpp
index 49981ee919..884523fb47 100644
--- a/src/bls/bls.cpp
+++ b/src/bls/bls.cpp
@@ -27,7 +27,7 @@ static const std::unique_ptr<bls::CoreMPL>& Scheme(const bool fLegacy)
 
 CBLSId::CBLSId(const uint256& nHash) : CBLSWrapper<CBLSIdImplicit, BLS_CURVE_ID_SIZE, CBLSId>()
 {
-    impl = nHash;
+    impl = CBLSIdImplicit{nHash};
     fValid = true;
     cachedHash.SetNull();
 }
diff --git a/src/bls/bls.h b/src/bls/bls.h
index 02a3bbefa5..dba9f198a2 100644
--- a/src/bls/bls.h
+++ b/src/bls/bls.h
@@ -234,7 +234,7 @@ public:
 struct CBLSIdImplicit : public uint256
 {
     CBLSIdImplicit() = default;
-    CBLSIdImplicit(const uint256& id)
+    explicit CBLSIdImplicit(const uint256& id)
     {
         memcpy(begin(), id.begin(), sizeof(uint256));
     }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring making CBLSIdImplicit explicit to a follow-up PR. The intentional implicit conversion is still used at the CBLSId construction site (impl = nHash), and tightening that is a small but separate API-style change that can be done with its own call-site audit.

{
memcpy(begin(), id.begin(), sizeof(uint256));
Expand Down Expand Up @@ -434,6 +436,7 @@ class CBLSLazyWrapper
return *this;
}

// cppcheck-suppress functionStatic
inline void Serialize(CSizeComputer& s) const
{
s.seek(BLSObject::SerSize);
Expand Down
10 changes: 5 additions & 5 deletions src/bls/bls_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ struct Aggregator : public std::enable_shared_from_this<Aggregator<T>> {
}
}

const T* pointer(const T& v) { return &v; }
const T* pointer(const T* v) { return v; }
static const T* pointer(const T& v) { return &v; }
static const T* pointer(const T* v) { return v; }

// Starts aggregation.
// If parallel=true, then this will return fast, otherwise this will block until aggregation is done
Expand Down Expand Up @@ -297,7 +297,7 @@ struct Aggregator : public std::enable_shared_from_this<Aggregator<T>> {
}

template <typename TP>
T SyncAggregate(Span<TP> vec, size_t start, size_t count)
static T SyncAggregate(Span<TP> vec, size_t start, size_t count)
{
T result = *vec[start];
for (size_t j = 1; j < count; j++) {
Expand Down Expand Up @@ -382,8 +382,8 @@ struct VectorAggregator : public std::enable_shared_from_this<VectorAggregator<T
// Same rules as in Aggregator apply for the inputs
struct ContributionVerifier : public std::enable_shared_from_this<ContributionVerifier> {
struct BatchState {
size_t start;
size_t count;
size_t start{0};
size_t count{0};

BLSVerificationVectorPtr vvec;
CBLSSecretKey skShare;
Expand Down
2 changes: 1 addition & 1 deletion src/chainlock/chainlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Chainlocks
chainlock::ChainLockSig bestChainLockWithKnownBlock GUARDED_BY(cs);

public:
Chainlocks(const CSporkManager& sporkman);
explicit Chainlocks(const CSporkManager& sporkman);

[[nodiscard]] bool IsEnabled() const;
[[nodiscard]] bool IsSigningEnabled() const;
Expand Down
2 changes: 1 addition & 1 deletion src/chainlock/signing.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ChainLockSigner final : public llmq::CRecoveredSigsListener, public CValid
ChainlockHandler& clhandler, const llmq::CInstantSendManager& isman,
const llmq::CQuorumManager& qman, llmq::CSigningManager& sigman,
llmq::CSigSharesManager& shareman, const CMasternodeSync& mn_sync);
~ChainLockSigner();
~ChainLockSigner() override;

void Start();
void Stop();
Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CPendingDsaRequest
}

[[nodiscard]] uint256 GetProTxHash() const { return proTxHash; }
[[nodiscard]] CCoinJoinAccept GetDSA() const { return dsa; }
[[nodiscard]] const CCoinJoinAccept& GetDSA() const { return dsa; }
[[nodiscard]] bool IsExpired() const { return GetTime() - nTimeCreated > TIMEOUT; }

friend bool operator==(const CPendingDsaRequest& a, const CPendingDsaRequest& b)
Expand Down Expand Up @@ -214,7 +214,7 @@ class CCoinJoinClientManager : public interfaces::CoinJoin::Client
explicit CCoinJoinClientManager(const std::shared_ptr<wallet::CWallet>& wallet, CDeterministicMNManager& dmnman,
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
const llmq::CInstantSendManager& isman, CoinJoinQueueManager* queueman);
~CCoinJoinClientManager();
~CCoinJoinClientManager() override;

void ProcessMessage(CNode& peer, Chainstate& active_chainstate, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);

Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/coinjoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class CDSTXManager
public:
CDSTXManager(const CDSTXManager&) = delete;
CDSTXManager& operator=(const CDSTXManager&) = delete;
CDSTXManager(const chainlock::Chainlocks& chainlocks);
explicit CDSTXManager(const chainlock::Chainlocks& chainlocks);
~CDSTXManager();

void AddDSTX(const CCoinJoinBroadcastTx& dstx) EXCLUSIVE_LOCKS_REQUIRED(!cs_mapdstx);
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class CCoinJoinServer : public CCoinJoinBaseSession, public NetHandler
CDeterministicMNManager& dmnman, CDSTXManager& dstxman, CMasternodeMetaMan& mn_metaman,
CTxMemPool& mempool, const CActiveMasternodeManager& mn_activeman,
const CMasternodeSync& mn_sync, const llmq::CInstantSendManager& isman);
~CCoinJoinServer();
~CCoinJoinServer() override;

void ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRecv) override;
bool ProcessGetData(CNode& pfrom, const CInv& inv, const CNetMsgMaker& msgMaker) override;
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CTransactionBuilderOutput
CTransactionBuilderOutput(CTransactionBuilderOutput&&) = delete;
CTransactionBuilderOutput& operator=(CTransactionBuilderOutput&&) = delete;
/// Get the scriptPubKey of this output
[[nodiscard]] CScript GetScript() const { return script; }
[[nodiscard]] const CScript& GetScript() const { return script; }
/// Get the amount of this output
[[nodiscard]] CAmount GetAmount() const { return nAmount; }
/// Try update the amount of this output. Returns true if it was successful and false if not (e.g. insufficient amount left).
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/walletman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ MessageProcessingResult CJWalletManagerImpl::ProcessDSQueue(NodeId from, CConnma
dmn->proTxHash.ToString(), dsq.ToString());

ForAnyCJClientMan(
[&dsq](CCoinJoinClientManager& clientman) { return clientman.MarkAlreadyJoinedQueueAsTried(dsq); });
[&dsq](const CCoinJoinClientManager& clientman) { return clientman.MarkAlreadyJoinedQueueAsTried(dsq); });

m_queueman->AddQueue(dsq);
}
Expand Down
7 changes: 3 additions & 4 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,8 +1135,7 @@ bool CDeterministicMNManager::MigrateLegacyDiffs(const CBlockIndex* const tip_in
}

CDeterministicMNManager::RecalcDiffsResult CDeterministicMNManager::RecalculateAndRepairDiffs(
const CBlockIndex* start_index, const CBlockIndex* stop_index, ChainstateManager& chainman,
BuildListFromBlockFunc build_list_func, bool repair)
const CBlockIndex* start_index, const CBlockIndex* stop_index, BuildListFromBlockFunc build_list_func, bool repair)
{
RecalcDiffsResult result;
result.start_height = start_index->nHeight;
Expand Down Expand Up @@ -1237,7 +1236,7 @@ CDeterministicMNManager::RecalcDiffsResult CDeterministicMNManager::RecalculateA

// Write repaired diffs to database
if (repair) {
WriteRepairedDiffs(recalculated_diffs, result);
WriteRepairedDiffs(recalculated_diffs);
}

return result;
Expand Down Expand Up @@ -1426,7 +1425,7 @@ std::vector<std::pair<uint256, CDeterministicMNListDiff>> CDeterministicMNManage
}

void CDeterministicMNManager::WriteRepairedDiffs(
const std::vector<std::pair<uint256, CDeterministicMNListDiff>>& recalculated_diffs, RecalcDiffsResult& result)
const std::vector<std::pair<uint256, CDeterministicMNListDiff>>& recalculated_diffs)
{
AssertLockNotHeld(cs);

Expand Down
15 changes: 8 additions & 7 deletions src/evo/deterministicmns.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ class CDeterministicMNList

private:
template <typename T>
[[nodiscard]] uint256 GetUniquePropertyHash(const T& v) const
[[nodiscard]] static uint256 GetUniquePropertyHash(const T& v)
{
#define DMNL_NO_TEMPLATE(name) \
static_assert(!std::is_same_v<std::decay_t<T>, name>, "GetUniquePropertyHash cannot be templated against " #name)
Expand Down Expand Up @@ -805,7 +805,7 @@ class CDeterministicMNManager
CDeterministicMNList& mnListRet)>;

[[nodiscard]] RecalcDiffsResult RecalculateAndRepairDiffs(const CBlockIndex* start_index,
const CBlockIndex* stop_index, ChainstateManager& chainman,
const CBlockIndex* stop_index,
BuildListFromBlockFunc build_list_func, bool repair)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
[[nodiscard]] bool IsRepaired() const;
Expand All @@ -820,15 +820,16 @@ class CDeterministicMNManager
CDeterministicMNList GetListForBlockInternal(gsl::not_null<const CBlockIndex*> pindex) EXCLUSIVE_LOCKS_REQUIRED(cs);

// Helper methods for RecalculateAndRepairDiffs
std::vector<const CBlockIndex*> CollectSnapshotBlocks(const CBlockIndex* start_index, const CBlockIndex* stop_index,
const Consensus::Params& consensus_params);
static std::vector<const CBlockIndex*> CollectSnapshotBlocks(const CBlockIndex* start_index,
const CBlockIndex* stop_index,
const Consensus::Params& consensus_params);
bool VerifySnapshotPair(const CBlockIndex* from_index, const CBlockIndex* to_index,
const CDeterministicMNList& from_snapshot, const CDeterministicMNList& to_snapshot,
RecalcDiffsResult& result);
std::vector<std::pair<uint256, CDeterministicMNListDiff>> RepairSnapshotPair(
static std::vector<std::pair<uint256, CDeterministicMNListDiff>> RepairSnapshotPair(
const CBlockIndex* from_index, const CBlockIndex* to_index, const CDeterministicMNList& from_snapshot,
const CDeterministicMNList& to_snapshot, BuildListFromBlockFunc build_list_func, RecalcDiffsResult& result);
void WriteRepairedDiffs(const std::vector<std::pair<uint256, CDeterministicMNListDiff>>& recalculated_diffs,
RecalcDiffsResult& result) EXCLUSIVE_LOCKS_REQUIRED(!cs);
void WriteRepairedDiffs(const std::vector<std::pair<uint256, CDeterministicMNListDiff>>& recalculated_diffs)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
};
#endif // BITCOIN_EVO_DETERMINISTICMNS_H
4 changes: 2 additions & 2 deletions src/evo/dmn_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace dmn_types {

struct mntype_struct
{
const int32_t voting_weight;
const CAmount collat_amount;
const int32_t voting_weight{0};
const CAmount collat_amount{0};
const std::string_view description;
};

Expand Down
2 changes: 1 addition & 1 deletion src/evo/mnhftx.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CMNHFManager : public AbstractEHFManager
CMNHFManager(const CMNHFManager&) = delete;
CMNHFManager& operator=(const CMNHFManager&) = delete;
explicit CMNHFManager(CEvoDB& evoDb, const ChainstateManager& chainman);
~CMNHFManager();
~CMNHFManager() override;

/**
* Every new block should be processed when Tip() is updated by calling of CMNHFManager::ProcessBlock.
Expand Down
4 changes: 2 additions & 2 deletions src/evo/netinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ bool ExtNetInfo::IsAddrPortDuplicate(const NetInfoEntry& candidate) const
[&candidate](const auto& entry) { return candidate == entry; });
}

bool ExtNetInfo::HasAddrDuplicates(const NetInfoList& entries) const
bool ExtNetInfo::HasAddrDuplicates(const NetInfoList& entries)
{
std::unordered_set<std::string> known{};
for (const auto& entry : entries) {
Expand All @@ -412,7 +412,7 @@ bool ExtNetInfo::HasAddrDuplicates(const NetInfoList& entries) const
return false;
}

bool ExtNetInfo::IsAddrDuplicate(const NetInfoEntry& candidate, const NetInfoList& entries) const
bool ExtNetInfo::IsAddrDuplicate(const NetInfoEntry& candidate, const NetInfoList& entries)
{
const std::string& candidate_str{candidate.ToStringAddr()};
return std::any_of(entries.begin(), entries.end(),
Expand Down
5 changes: 3 additions & 2 deletions src/evo/netinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class MnNetInfo final : public NetInfoInterface
}
}

// cppcheck-suppress functionStatic
void Serialize(CSizeComputer& s) const
{
s.seek(::GetSerializeSize(CService{}, s.GetVersion()));
Expand Down Expand Up @@ -375,10 +376,10 @@ class ExtNetInfo final : public NetInfoInterface
bool IsAddrPortDuplicate(const NetInfoEntry& candidate) const;

/** Returns true if there are addr duplicates within a given address list */
bool HasAddrDuplicates(const NetInfoList& entries) const;
static bool HasAddrDuplicates(const NetInfoList& entries);

/** Returns true if candidate is an addr duplicate within a given address list */
bool IsAddrDuplicate(const NetInfoEntry& candidate, const NetInfoList& entries) const;
static bool IsAddrDuplicate(const NetInfoEntry& candidate, const NetInfoList& entries);

/** Validate uniqueness requirements and add to object if passed */
NetInfoStatus ProcessCandidate(const NetInfoPurpose purpose, const NetInfoEntry& candidate);
Expand Down
5 changes: 2 additions & 3 deletions src/evo/simplifiedmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ std::string CSimplifiedMNListEntry::ToString() const
(nVersion >= ProTxVersion::ExtAddr ? "" : strprintf(", platformHTTPPort=%d", platformHTTPPort)));
}

CSimplifiedMNList::CSimplifiedMNList(std::vector<std::unique_ptr<CSimplifiedMNListEntry>>&& smlEntries)
CSimplifiedMNList::CSimplifiedMNList(std::vector<std::unique_ptr<CSimplifiedMNListEntry>>&& smlEntries) :
mnList{std::move(smlEntries)}
{
mnList = std::move(smlEntries);

std::sort(mnList.begin(), mnList.end(), [&](const std::unique_ptr<CSimplifiedMNListEntry>& a, const std::unique_ptr<CSimplifiedMNListEntry>& b) {
return a->proRegTxHash.Compare(b->proRegTxHash) < 0;
});
Expand Down
10 changes: 6 additions & 4 deletions src/evo/specialtxman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ bool CSpecialTxProcessor::RebuildListFromBlock(const CBlock& block, gsl::not_nul
{
// Verify that prevList either represents an empty/initial state (default-constructed),
// or it matches the previous block's hash.
// cppcheck-suppress assertWithSideEffect
assert(prevList == CDeterministicMNList() || prevList.GetBlockHash() == pindexPrev->GetBlockHash());

int nHeight = pindexPrev->nHeight + 1;
Expand Down Expand Up @@ -699,9 +700,6 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(Chainstate& chainstate, const
static int64_t nTimeLoop = 0;
static int64_t nTimeQuorum = 0;
static int64_t nTimeDMN = 0;
static int64_t nTimeMerkleMNL = 0;
static int64_t nTimeMerkleQuorums = 0;
static int64_t nTimeCbTxCL = 0;
static int64_t nTimeMnehf = 0;
static int64_t nTimePayload = 0;
static int64_t nTimeCreditPool = 0;
Expand Down Expand Up @@ -809,6 +807,10 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(Chainstate& chainstate, const
nTimeDMN * 0.000001);

if (opt_cbTx.has_value()) {
static int64_t nTimeMerkleMNL = 0;
static int64_t nTimeMerkleQuorums = 0;
static int64_t nTimeCbTxCL = 0;

uint256 calculatedMerkleRootMNL;
if (!CalcCbTxMerkleRootMNList(calculatedMerkleRootMNL, mn_list.to_sml(), state)) {
// pass the state returned by the function above
Expand Down Expand Up @@ -882,7 +884,7 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(Chainstate& chainstate, const
return true;
}

bool CSpecialTxProcessor::UndoSpecialTxsInBlock(Chainstate& chainstate, const CBlock& block, const CBlockIndex* pindex, std::optional<MNListUpdates>& updatesRet)
bool CSpecialTxProcessor::UndoSpecialTxsInBlock(const Chainstate& chainstate, const CBlock& block, const CBlockIndex* pindex, std::optional<MNListUpdates>& updatesRet)
{
AssertLockHeld(::cs_main);

Expand Down
2 changes: 1 addition & 1 deletion src/evo/specialtxman.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CSpecialTxProcessor
bool ProcessSpecialTxsInBlock(Chainstate& chainstate, const CBlock& block, const CBlockIndex* pindex, const CCoinsViewCache& view, bool fJustCheck,
bool fCheckCbTxMerkleRoots, BlockValidationState& state, std::optional<MNListUpdates>& updatesRet)
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
bool UndoSpecialTxsInBlock(Chainstate& chainstate, const CBlock& block, const CBlockIndex* pindex, std::optional<MNListUpdates>& updatesRet)
bool UndoSpecialTxsInBlock(const Chainstate& chainstate, const CBlock& block, const CBlockIndex* pindex, std::optional<MNListUpdates>& updatesRet)
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);


Expand Down
4 changes: 2 additions & 2 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ bool CGovernanceManager::MasternodeRateCheck(const CGovernanceObject& govobj, bo
return false;
}

bool CGovernanceManager::ProcessVoteAndRelay(const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman)
bool CGovernanceManager::ProcessVoteAndRelay(const CGovernanceVote& vote, CGovernanceException& exception)
{
AssertLockNotHeld(cs_store);
AssertLockNotHeld(cs_relay);
Expand Down Expand Up @@ -1156,7 +1156,7 @@ void CGovernanceManager::RemoveInvalidVotes()
if (removed.empty()) {
continue;
}
for (auto& voteHash : removed) {
for (const auto& voteHash : removed) {
cmapVoteToObject.Erase(voteHash);
cmapInvalidVotes.Erase(voteHash);
cmmapOrphanVotes.Erase(voteHash);
Expand Down
Loading
Loading