Skip to content

Commit 7da6d06

Browse files
committed
fmt: clang-format for active/context and other files
1 parent 46302be commit 7da6d06

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

src/evo/specialtxman.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ static bool CheckHashSig(const ProTx& proTx, const PKHash& pkhash, TxValidationS
841841
template <typename ProTx>
842842
static bool CheckStringSig(const ProTx& proTx, const PKHash& pkhash, TxValidationState& state)
843843
{
844-
if (std::string strError; !CMessageSigner::VerifyMessage(ToKeyID(pkhash), proTx.vchSig, proTx.MakeSignString(), strError)) {
844+
if (std::string strError;
845+
!CMessageSigner::VerifyMessage(ToKeyID(pkhash), proTx.vchSig, proTx.MakeSignString(), strError)) {
845846
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-sig");
846847
}
847848
return true;
@@ -887,8 +888,8 @@ static std::optional<ProTx> GetValidatedPayload(const CTransaction& tx, gsl::not
887888
* @returns true if version change is valid or DEPLOYMENT_V24 is not active
888889
*/
889890
static bool IsVersionChangeValid(gsl::not_null<const CBlockIndex*> pindexPrev, const uint16_t tx_type,
890-
const uint16_t state_version, const uint16_t tx_version, const ChainstateManager& chainman,
891-
TxValidationState& state)
891+
const uint16_t state_version, const uint16_t tx_version,
892+
const ChainstateManager& chainman, TxValidationState& state)
892893
{
893894
if (!DeploymentActiveAfter(pindexPrev, chainman, Consensus::DEPLOYMENT_V24)) {
894895
// New restrictions only apply after v24 deployment
@@ -930,8 +931,8 @@ bool CheckProRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> pin
930931
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-version-disallowed");
931932
}
932933

933-
// 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
934-
// If any of both is set, it must be valid however
934+
// It's allowed to set addr to 0, which will put the MN into PoSe-banned state and require a ProUpServTx to be
935+
// issues later. If any of both is set, it must be valid however
935936
if (!opt_ptx->netInfo->IsEmpty() && !CheckService(*opt_ptx, state)) {
936937
// pass the state returned by the function above
937938
return false;
@@ -944,7 +945,7 @@ bool CheckProRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> pin
944945
}
945946

946947
CTxDestination collateralTxDest;
947-
const PKHash *keyForPayloadSig = nullptr;
948+
const PKHash* keyForPayloadSig = nullptr;
948949
COutPoint collateralOutpoint;
949950

950951
CAmount expectedCollateral = GetMnType(opt_ptx->nType).collat_amount;
@@ -984,7 +985,8 @@ bool CheckProRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> pin
984985

985986
// don't allow reuse of collateral key for other keys (don't allow people to put the collateral key onto an online server)
986987
// this check applies to internal and external collateral, but internal collaterals are not necessarily a P2PKH
987-
if (collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDOwner)) || collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
988+
if (collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDOwner)) ||
989+
collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
988990
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-collateral-reuse");
989991
}
990992

@@ -1087,7 +1089,8 @@ bool CheckProUpServTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*>
10871089
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-dup-netinfo-entry");
10881090
}
10891091
} else if (const auto domain_opt{entry.GetDomainPort()}) {
1090-
if (mnList.HasUniqueProperty(*domain_opt) && mnList.GetUniquePropertyMN(*domain_opt)->proTxHash != opt_ptx->proTxHash) {
1092+
if (mnList.HasUniqueProperty(*domain_opt) &&
1093+
mnList.GetUniquePropertyMN(*domain_opt)->proTxHash != opt_ptx->proTxHash) {
10911094
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-dup-netinfo-entry");
10921095
}
10931096
} else {
@@ -1097,7 +1100,8 @@ bool CheckProUpServTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*>
10971100

10981101
// don't allow updating to platformNodeIds already used by other EvoNodes
10991102
if (opt_ptx->nType == MnType::Evo) {
1100-
if (mnList.HasUniqueProperty(opt_ptx->platformNodeID) && mnList.GetUniquePropertyMN(opt_ptx->platformNodeID)->proTxHash != opt_ptx->proTxHash) {
1103+
if (mnList.HasUniqueProperty(opt_ptx->platformNodeID) &&
1104+
mnList.GetUniquePropertyMN(opt_ptx->platformNodeID)->proTxHash != opt_ptx->proTxHash) {
11011105
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-dup-platformnodeid");
11021106
}
11031107
}
@@ -1153,7 +1157,8 @@ bool CheckProUpRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> p
11531157
}
11541158

11551159
// don't allow reuse of payee key for other keys (don't allow people to put the payee key onto an online server)
1156-
if (payoutDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) || payoutDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
1160+
if (payoutDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) ||
1161+
payoutDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
11571162
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-payee-reuse");
11581163
}
11591164

@@ -1168,7 +1173,8 @@ bool CheckProUpRegTx(const CTransaction& tx, gsl::not_null<const CBlockIndex*> p
11681173
if (!ExtractDestination(coin.out.scriptPubKey, collateralTxDest)) {
11691174
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-collateral-dest");
11701175
}
1171-
if (collateralTxDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) || collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
1176+
if (collateralTxDest == CTxDestination(PKHash(dmn->pdmnState->keyIDOwner)) ||
1177+
collateralTxDest == CTxDestination(PKHash(opt_ptx->keyIDVoting))) {
11721178
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-protx-collateral-reuse");
11731179
}
11741180

0 commit comments

Comments
 (0)