Skip to content

Commit bbd8731

Browse files
committed
fmt: apply clang-format suggestions
1 parent c2e053f commit bbd8731

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

src/evo/smldiff.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#include <node/blockstorage.h>
1919
#include <serialize.h>
2020
#include <univalue.h>
21-
#include <validation.h>
2221
#include <util/enumerate.h>
22+
#include <validation.h>
2323

2424
using node::ReadBlockFromDisk;
2525

@@ -68,9 +68,10 @@ bool CSimplifiedMNListDiff::BuildQuorumsDiff(const CBlockIndex* baseBlockIndex,
6868

6969
bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager& qman, const CBlockIndex* blockIndex)
7070
{
71-
// Group quorums (indexes corresponding to entries of newQuorums) per CBlockIndex containing the expected CL signature in CbTx.
72-
// We want to avoid to load CbTx now, as more than one quorum will target the same block: hence we want to load CbTxs once per block (heavy operation).
73-
std::multimap<const CBlockIndex*, uint16_t> workBaseBlockIndexMap;
71+
// Group quorums (indexes corresponding to entries of newQuorums) per CBlockIndex containing the expected CL
72+
// signature in CbTx. We want to avoid to load CbTx now, as more than one quorum will target the same block: hence
73+
// we want to load CbTxs once per block (heavy operation).
74+
std::multimap<const CBlockIndex*, uint16_t> workBaseBlockIndexMap;
7475

7576
for (const auto [idx, e] : enumerate(newQuorums)) {
7677
// We assume that we have on hand, quorums that correspond to the hashes queried.
@@ -83,10 +84,10 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager&
8384
return false;
8485
}
8586

86-
// In case of rotation, all rotated quorums rely on the CL sig expected in the cycleBlock (the block of the first DKG) - 8
87-
// In case of non-rotation, quorums rely on the CL sig expected in the block of the DKG - 8
88-
const CBlockIndex* pWorkBaseBlockIndex =
89-
blockIndex->GetAncestor(quorum->m_quorum_base_block_index->nHeight - quorum->qc->quorumIndex - 8);
87+
// In case of rotation, all rotated quorums rely on the CL sig expected in the cycleBlock (the block of the
88+
// first DKG) - 8 In case of non-rotation, quorums rely on the CL sig expected in the block of the DKG - 8
89+
const CBlockIndex* pWorkBaseBlockIndex = blockIndex->GetAncestor(quorum->m_quorum_base_block_index->nHeight -
90+
quorum->qc->quorumIndex - 8);
9091

9192
workBaseBlockIndexMap.insert(std::make_pair(pWorkBaseBlockIndex, idx));
9293
}
@@ -102,7 +103,8 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager&
102103
// Get the range of indexes (values) for the current key and merge them into a single std::set
103104
const auto [it_begin, it_end] = workBaseBlockIndexMap.equal_range(it->first);
104105
std::set<uint16_t> idx_set;
105-
std::transform(it_begin, it_end, std::inserter(idx_set, idx_set.end()), [](const auto& pair) { return pair.second; });
106+
std::transform(it_begin, it_end, std::inserter(idx_set, idx_set.end()),
107+
[](const auto& pair) { return pair.second; });
106108
// Advance the iterator to the next key
107109
it = it_end;
108110

@@ -130,9 +132,9 @@ CSimplifiedMNListDiff BuildSimplifiedDiff(const CDeterministicMNList& from, cons
130132
} else {
131133
CSimplifiedMNListEntry sme1(toPtr);
132134
CSimplifiedMNListEntry sme2(*fromPtr);
133-
if ((sme1 != sme2) ||
134-
(extended && (sme1.scriptPayout != sme2.scriptPayout || sme1.scriptOperatorPayout != sme2.scriptOperatorPayout))) {
135-
diffRet.mnList.push_back(std::move(sme1));
135+
if ((sme1 != sme2) || (extended && (sme1.scriptPayout != sme2.scriptPayout ||
136+
sme1.scriptOperatorPayout != sme2.scriptOperatorPayout))) {
137+
diffRet.mnList.push_back(std::move(sme1));
136138
}
137139
}
138140
});
@@ -147,8 +149,9 @@ CSimplifiedMNListDiff BuildSimplifiedDiff(const CDeterministicMNList& from, cons
147149
return diffRet;
148150
}
149151

150-
bool BuildSimplifiedMNListDiff(CDeterministicMNManager& dmnman, const ChainstateManager& chainman, const llmq::CQuorumBlockProcessor& qblockman,
151-
const llmq::CQuorumManager& qman, const uint256& baseBlockHash, const uint256& blockHash,
152+
bool BuildSimplifiedMNListDiff(CDeterministicMNManager& dmnman, const ChainstateManager& chainman,
153+
const llmq::CQuorumBlockProcessor& qblockman, const llmq::CQuorumManager& qman,
154+
const uint256& baseBlockHash, const uint256& blockHash,
152155
CSimplifiedMNListDiff& mnListDiffRet, std::string& errorRet, bool extended)
153156
{
154157
AssertLockHeld(::cs_main);

src/evo/smldiff.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ class CGetSimplifiedMNListDiff
3838
uint256 baseBlockHash;
3939
uint256 blockHash;
4040

41-
SERIALIZE_METHODS(CGetSimplifiedMNListDiff, obj)
42-
{
43-
READWRITE(obj.baseBlockHash, obj.blockHash);
44-
}
41+
SERIALIZE_METHODS(CGetSimplifiedMNListDiff, obj) { READWRITE(obj.baseBlockHash, obj.blockHash); }
4542
};
4643

4744
class CSimplifiedMNListDiff
@@ -70,7 +67,8 @@ class CSimplifiedMNListDiff
7067
READWRITE(obj.nVersion);
7168
}
7269
READWRITE(obj.baseBlockHash, obj.blockHash, obj.cbTxMerkleTree, obj.cbTx);
73-
if ((s.GetType() & SER_NETWORK) && s.GetVersion() >= BLS_SCHEME_PROTO_VERSION && s.GetVersion() < MNLISTDIFF_VERSION_ORDER) {
70+
if ((s.GetType() & SER_NETWORK) && s.GetVersion() >= BLS_SCHEME_PROTO_VERSION &&
71+
s.GetVersion() < MNLISTDIFF_VERSION_ORDER) {
7472
READWRITE(obj.nVersion);
7573
}
7674
READWRITE(obj.deletedMNs, obj.mnList);

0 commit comments

Comments
 (0)