Skip to content

Commit 71abb3c

Browse files
committed
fmt: clang-format for specialtxman.cpp and for active/context
1 parent 3e8831a commit 71abb3c

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

src/active/context.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
#include <validation.h>
2525

2626
ActiveContext::ActiveContext(CBLSWorker& bls_worker, ChainstateManager& chainman, CConnman& connman,
27-
CDeterministicMNManager& dmnman, CGovernanceManager& govman,
28-
CMasternodeMetaMan& mn_metaman, CSporkManager& sporkman,
29-
CTxMemPool& mempool, llmq::CChainLocksHandler& clhandler, llmq::CInstantSendManager& isman,
30-
llmq::CQuorumBlockProcessor& qblockman, llmq::CQuorumManager& qman,
31-
llmq::CQuorumSnapshotManager& qsnapman, llmq::CSigningManager& sigman,
32-
PeerManager& peerman, const CMasternodeSync& mn_sync, const CBLSSecretKey& operator_sk,
33-
const llmq::QvvecSyncModeMap& sync_map, const util::DbWrapperParams& db_params,
34-
bool quorums_recovery, bool quorums_watch) :
27+
CDeterministicMNManager& dmnman, CGovernanceManager& govman, CMasternodeMetaMan& mn_metaman,
28+
CSporkManager& sporkman, CTxMemPool& mempool, llmq::CChainLocksHandler& clhandler,
29+
llmq::CInstantSendManager& isman, llmq::CQuorumBlockProcessor& qblockman,
30+
llmq::CQuorumManager& qman, llmq::CQuorumSnapshotManager& qsnapman,
31+
llmq::CSigningManager& sigman, PeerManager& peerman, const CMasternodeSync& mn_sync,
32+
const CBLSSecretKey& operator_sk, const llmq::QvvecSyncModeMap& sync_map,
33+
const util::DbWrapperParams& db_params, bool quorums_recovery, bool quorums_watch) :
3534
m_clhandler{clhandler},
3635
m_isman{isman},
3736
m_qman{qman},

src/active/context.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ struct ActiveContext final : public CValidationInterface {
6363
ActiveContext& operator=(const ActiveContext&) = delete;
6464
explicit ActiveContext(CBLSWorker& bls_worker, ChainstateManager& chainman, CConnman& connman,
6565
CDeterministicMNManager& dmnman, CGovernanceManager& govman, CMasternodeMetaMan& mn_metaman,
66-
CSporkManager& sporkman, CTxMemPool& mempool,
67-
llmq::CChainLocksHandler& clhandler, llmq::CInstantSendManager& isman,
68-
llmq::CQuorumBlockProcessor& qblockman, llmq::CQuorumManager& qman,
69-
llmq::CQuorumSnapshotManager& qsnapman, llmq::CSigningManager& sigman, PeerManager& peerman,
70-
const CMasternodeSync& mn_sync, const CBLSSecretKey& operator_sk,
71-
const llmq::QvvecSyncModeMap& sync_map, const util::DbWrapperParams& db_params,
72-
bool quorums_recovery, bool quorums_watch);
66+
CSporkManager& sporkman, CTxMemPool& mempool, llmq::CChainLocksHandler& clhandler,
67+
llmq::CInstantSendManager& isman, llmq::CQuorumBlockProcessor& qblockman,
68+
llmq::CQuorumManager& qman, llmq::CQuorumSnapshotManager& qsnapman,
69+
llmq::CSigningManager& sigman, PeerManager& peerman, const CMasternodeSync& mn_sync,
70+
const CBLSSecretKey& operator_sk, const llmq::QvvecSyncModeMap& sync_map,
71+
const util::DbWrapperParams& db_params, bool quorums_recovery, bool quorums_watch);
7372
~ActiveContext();
7473

7574
void Interrupt();

src/evo/specialtxman.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,8 @@ static bool CheckHashSig(const ProTx& proTx, const PKHash& pkhash, TxValidationS
838838
template <typename ProTx>
839839
static bool CheckStringSig(const ProTx& proTx, const PKHash& pkhash, TxValidationState& state)
840840
{
841-
if (std::string strError; !CMessageSigner::VerifyMessage(ToKeyID(pkhash), proTx.vchSig, proTx.MakeSignString(), strError)) {
841+
if (std::string strError;
842+
!CMessageSigner::VerifyMessage(ToKeyID(pkhash), proTx.vchSig, proTx.MakeSignString(), strError)) {
842843
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-sig");
843844
}
844845
return true;
@@ -884,8 +885,8 @@ static std::optional<ProTx> GetValidatedPayload(const CTransaction& tx, gsl::not
884885
* @returns true if version change is valid or DEPLOYMENT_V24 is not active
885886
*/
886887
static bool IsVersionChangeValid(gsl::not_null<const CBlockIndex*> pindexPrev, const uint16_t tx_type,
887-
const uint16_t state_version, const uint16_t tx_version, const ChainstateManager& chainman,
888-
TxValidationState& state)
888+
const uint16_t state_version, const uint16_t tx_version,
889+
const ChainstateManager& chainman, TxValidationState& state)
889890
{
890891
if (!DeploymentActiveAfter(pindexPrev, chainman, Consensus::DEPLOYMENT_V24)) {
891892
// New restrictions only apply after v24 deployment
@@ -927,8 +928,8 @@ bool CheckProRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> pin
927928
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-version-disallowed");
928929
}
929930

930-
// It's allowed to set addr to 0, which will put the MN into PoSe-banned state and require a ProUpServTx to be issues later
931-
// If any of both is set, it must be valid however
931+
// It's allowed to set addr to 0, which will put the MN into PoSe-banned state and require a ProUpServTx to be
932+
// issues later. If any of both is set, it must be valid however
932933
if (!opt_ptx->netInfo->IsEmpty() && !CheckService(*opt_ptx, state)) {
933934
// pass the state returned by the function above
934935
return false;
@@ -941,7 +942,7 @@ bool CheckProRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> pin
941942
}
942943

943944
CTxDestination collateralTxDest;
944-
const PKHash *keyForPayloadSig = nullptr;
945+
const PKHash* keyForPayloadSig = nullptr;
945946
COutPoint collateralOutpoint;
946947

947948
CAmount expectedCollateral = GetMnType(opt_ptx->nType).collat_amount;
@@ -981,7 +982,8 @@ bool CheckProRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> pin
981982

982983
// don't allow reuse of collateral key for other keys (don't allow people to put the collateral key onto an online server)
983984
// this check applies to internal and external collateral, but internal collaterals are not necessarily a P2PKH
984-
if (collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDOwner)) || collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
985+
if (collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDOwner)) ||
986+
collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
985987
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-collateral-reuse");
986988
}
987989

@@ -1084,7 +1086,8 @@ bool CheckProUpServTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*>
10841086
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-dup-netinfo-entry");
10851087
}
10861088
} else if (const auto domain_opt{entry.GetDomainPort()}) {
1087-
if (mnList.HasUniqueProperty(*domain_opt) && mnList.GetUniquePropertyMN(*domain_opt)->proTxHash != opt_ptx->proTxHash) {
1089+
if (mnList.HasUniqueProperty(*domain_opt) &&
1090+
mnList.GetUniquePropertyMN(*domain_opt)->proTxHash != opt_ptx->proTxHash) {
10881091
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-dup-netinfo-entry");
10891092
}
10901093
} else {
@@ -1094,7 +1097,8 @@ bool CheckProUpServTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*>
10941097

10951098
// don't allow updating to platformNodeIds already used by other EvoNodes
10961099
if (opt_ptx->nType == MnType::Evo) {
1097-
if (mnList.HasUniqueProperty(opt_ptx->platformNodeID) && mnList.GetUniquePropertyMN(opt_ptx->platformNodeID)->proTxHash != opt_ptx->proTxHash) {
1100+
if (mnList.HasUniqueProperty(opt_ptx->platformNodeID) &&
1101+
mnList.GetUniquePropertyMN(opt_ptx->platformNodeID)->proTxHash != opt_ptx->proTxHash) {
10981102
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-dup-platformnodeid");
10991103
}
11001104
}
@@ -1150,7 +1154,8 @@ bool CheckProUpRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> p
11501154
}
11511155

11521156
// don't allow reuse of payee key for other keys (don't allow people to put the payee key onto an online server)
1153-
if (payoutDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) || payoutDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
1157+
if (payoutDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) ||
1158+
payoutDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
11541159
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-payee-reuse");
11551160
}
11561161

@@ -1165,7 +1170,8 @@ bool CheckProUpRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> p
11651170
if (!ExtractDestination(coin.out.scriptPubKey, collateralTxDest)) {
11661171
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-collateral-dest");
11671172
}
1168-
if (collateralTxDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) || collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
1173+
if (collateralTxDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) ||
1174+
collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
11691175
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-collateral-reuse");
11701176
}
11711177

0 commit comments

Comments
 (0)