@@ -99,7 +99,7 @@ void CPrivateSendClientManager::ProcessMessage(CNode* pfrom, const std::string&
9999 int64_t nLastDsq = mmetaman.GetMetaInfo (dmn->proTxHash )->GetLastDsq ();
100100 int nThreshold = nLastDsq + mnList.GetValidMNsCount () / 5 ;
101101 LogPrint (BCLog::PRIVATESEND, " DSQUEUE -- nLastDsq: %d threshold: %d nDsqCount: %d\n " , nLastDsq, nThreshold, mmetaman.GetDsqCount ());
102- // don't allow a few nodes to dominate the queuing process
102+ // don't allow a few nodes to dominate the queuing process
103103 if (nLastDsq != 0 && nThreshold > mmetaman.GetDsqCount ()) {
104104 LogPrint (BCLog::PRIVATESEND, " DSQUEUE -- Masternode %s is sending too many dsq messages\n " , dmn->proTxHash .ToString ());
105105 return ;
@@ -118,10 +118,9 @@ void CPrivateSendClientManager::ProcessMessage(CNode* pfrom, const std::string&
118118 dsq.Relay (connman);
119119 }
120120
121- } else if (
122- strCommand == NetMsgType::DSSTATUSUPDATE ||
123- strCommand == NetMsgType::DSFINALTX ||
124- strCommand == NetMsgType::DSCOMPLETE) {
121+ } else if (strCommand == NetMsgType::DSSTATUSUPDATE ||
122+ strCommand == NetMsgType::DSFINALTX ||
123+ strCommand == NetMsgType::DSCOMPLETE) {
125124 LOCK (cs_deqsessions);
126125 for (auto & session : deqSessions) {
127126 session.ProcessMessage (pfrom, strCommand, vRecv, connman);
@@ -201,7 +200,7 @@ void CPrivateSendClientSession::ProcessMessage(CNode* pfrom, const std::string&
201200
202201 LogPrint (BCLog::PRIVATESEND, " DSFINALTX -- txNew %s" , txNew.ToString ());
203202
204- // check to see if input is spent already? (and probably not confirmed)
203+ // check to see if input is spent already? (and probably not confirmed)
205204 SignFinalTransaction (txNew, pfrom, connman);
206205
207206 } else if (strCommand == NetMsgType::DSCOMPLETE) {
@@ -294,8 +293,9 @@ std::string CPrivateSendClientSession::GetStatus(bool fWaitForBlock)
294293 nStatusMessageProgress += 10 ;
295294 std::string strSuffix = " " ;
296295
297- if (fWaitForBlock || !masternodeSync.IsBlockchainSynced ())
296+ if (fWaitForBlock || !masternodeSync.IsBlockchainSynced ()) {
298297 return strAutoDenomResult;
298+ }
299299
300300 switch (nState) {
301301 case POOL_STATE_IDLE:
@@ -432,8 +432,7 @@ bool CPrivateSendClientSession::CheckTimeout()
432432 int nTimeout = (nState == POOL_STATE_SIGNING) ? PRIVATESEND_SIGNING_TIMEOUT : PRIVATESEND_QUEUE_TIMEOUT;
433433 bool fTimeout = GetTime () - nTimeLastSuccessfulStep >= nTimeout + nLagTime;
434434
435- if (nState == POOL_STATE_IDLE || !fTimeout )
436- return false ;
435+ if (nState == POOL_STATE_IDLE || !fTimeout ) return false ;
437436
438437 LogPrint (BCLog::PRIVATESEND, " CPrivateSendClientSession::CheckTimeout -- %s timed out (%ds) -- resetting\n " ,
439438 (nState == POOL_STATE_SIGNING) ? " Signing" : " Session" , nTimeout);
@@ -481,11 +480,13 @@ bool CPrivateSendClientSession::SendDenominate(const std::vector<std::pair<CTxDS
481480 }
482481
483482 // lock the funds we're going to use
484- for (const auto & txin : txMyCollateral.vin )
483+ for (const auto & txin : txMyCollateral.vin ) {
485484 vecOutPointLocked.push_back (txin.prevout );
485+ }
486486
487- for (const auto & pair : vecPSInOutPairsIn)
487+ for (const auto & pair : vecPSInOutPairsIn) {
488488 vecOutPointLocked.push_back (pair.first .prevout );
489+ }
489490
490491 // we should already be connected to a Masternode
491492 if (!nSessionID) {
@@ -630,8 +631,9 @@ bool CPrivateSendClientSession::SignFinalTransaction(const CTransaction& finalTr
630631 }
631632 }
632633
633- for (const auto & txout : entry.vecTxOut )
634+ for (const auto & txout : entry.vecTxOut ) {
634635 nValue2 += txout.nValue ;
636+ }
635637
636638 int nTargetOuputsCount = entry.vecTxOut .size ();
637639 if (nFoundOutputsCount < nTargetOuputsCount || nValue1 != nValue2) {
@@ -714,11 +716,9 @@ void CPrivateSendClientManager::AddSkippedDenom(const CAmount& nDenomValue)
714716
715717bool CPrivateSendClientManager::WaitForAnotherBlock ()
716718{
717- if (!masternodeSync.IsBlockchainSynced ())
718- return true ;
719+ if (!masternodeSync.IsBlockchainSynced ()) return true ;
719720
720- if (fPrivateSendMultiSession )
721- return false ;
721+ if (fPrivateSendMultiSession ) return false ;
722722
723723 return nCachedBlockHeight - nCachedLastSuccessBlock < nMinBlocksToWait;
724724}
@@ -921,8 +921,9 @@ bool CPrivateSendClientSession::DoAutomaticDenominating(CConnman& connman, bool
921921 }
922922
923923 // check if we have the collateral sized inputs
924- if (!pwalletMain->HasCollateralInputs ())
924+ if (!pwalletMain->HasCollateralInputs ()) {
925925 return !pwalletMain->HasCollateralInputs (false ) && MakeCollateralAmounts (connman);
926+ }
926927
927928 if (nSessionID) {
928929 strAutoDenomResult = _ (" Mixing in progress..." );
@@ -962,14 +963,14 @@ bool CPrivateSendClientSession::DoAutomaticDenominating(CConnman& connman, bool
962963
963964 bool fUseQueue = GetRandInt (100 ) > 33 ;
964965 // don't use the queues all of the time for mixing unless we are a liquidity provider
965- if ((privateSendClient.nLiquidityProvider || fUseQueue ) && JoinExistingQueue (nBalanceNeedsAnonymized, connman))
966+ if ((privateSendClient.nLiquidityProvider || fUseQueue ) && JoinExistingQueue (nBalanceNeedsAnonymized, connman)) {
966967 return true ;
968+ }
967969
968970 // do not initiate queue if we are a liquidity provider to avoid useless inter-mixing
969971 if (privateSendClient.nLiquidityProvider ) return false ;
970972
971- if (StartNewQueue (nBalanceNeedsAnonymized, connman))
972- return true ;
973+ if (StartNewQueue (nBalanceNeedsAnonymized, connman)) return true ;
973974
974975 strAutoDenomResult = _ (" No compatible Masternode found." );
975976 return false ;
@@ -1013,8 +1014,7 @@ bool CPrivateSendClientManager::DoAutomaticDenominating(CConnman& connman, bool
10131014 deqSessions.emplace_back ();
10141015 }
10151016 for (auto & session : deqSessions) {
1016- if (!CheckAutomaticBackup ())
1017- return false ;
1017+ if (!CheckAutomaticBackup ()) return false ;
10181018
10191019 if (WaitForAnotherBlock ()) {
10201020 LogPrintf (" CPrivateSendClientManager::DoAutomaticDenominating -- Last successful PrivateSend action was too recent\n " );
@@ -1456,8 +1456,9 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(const CompactTallyItem& ta
14561456 LOCK2 (cs_main, pwalletMain->cs_wallet );
14571457
14581458 // denominated input is always a single one, so we can check its amount directly and return early
1459- if (!fTryDenominated && tallyItem.vecOutPoints .size () == 1 && CPrivateSend::IsDenominatedAmount (tallyItem.nAmount ))
1459+ if (!fTryDenominated && tallyItem.vecOutPoints .size () == 1 && CPrivateSend::IsDenominatedAmount (tallyItem.nAmount )) {
14601460 return false ;
1461+ }
14611462
14621463 CWalletTx wtx;
14631464 CAmount nFeeRet = 0 ;
@@ -1483,8 +1484,9 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(const CompactTallyItem& ta
14831484 coinControl.fAllowWatchOnly = false ;
14841485 // send change to the same address so that we were able create more denoms out of it later
14851486 coinControl.destChange = tallyItem.txdest ;
1486- for (const auto & outpoint : tallyItem.vecOutPoints )
1487+ for (const auto & outpoint : tallyItem.vecOutPoints ) {
14871488 coinControl.Select (outpoint);
1489+ }
14881490
14891491 bool fSuccess = pwalletMain->CreateTransaction (vecSend, wtx, reservekeyChange,
14901492 nFeeRet, nChangePosRet, strFail, &coinControl, true , ONLY_NONDENOMINATED);
@@ -1643,8 +1645,9 @@ bool CPrivateSendClientSession::CreateDenominated(CAmount nBalanceToDenominate,
16431645 coinControl.fAllowWatchOnly = false ;
16441646 // send change to the same address so that we were able create more denoms out of it later
16451647 coinControl.destChange = tallyItem.txdest ;
1646- for (const auto & outpoint : tallyItem.vecOutPoints )
1648+ for (const auto & outpoint : tallyItem.vecOutPoints ) {
16471649 coinControl.Select (outpoint);
1650+ }
16481651
16491652 CWalletTx wtx;
16501653 CAmount nFeeRet = 0 ;
@@ -1705,8 +1708,7 @@ void CPrivateSendClientManager::DoMaintenance(CConnman& connman)
17051708 if (fLiteMode ) return ; // disable all Dash specific functionality
17061709 if (fMasternodeMode ) return ; // no client-side mixing on masternodes
17071710
1708- if (!masternodeSync.IsBlockchainSynced () || ShutdownRequested ())
1709- return ;
1711+ if (!masternodeSync.IsBlockchainSynced () || ShutdownRequested ()) return ;
17101712
17111713 static unsigned int nTick = 0 ;
17121714 static unsigned int nDoAutoNextRun = nTick + PRIVATESEND_AUTO_TIMEOUT_MIN;
0 commit comments