@@ -60,7 +60,6 @@ void CPrivateSendClientManager::ProcessMessage(CNode* pfrom, const std::string&
6060        LogPrint (" privatesend"  , " DSQUEUE -- %s new\n "  , dsq.ToString ());
6161
6262        if (dsq.IsExpired ()) return ;
63-         if (dsq.nInputCount  < 0  || dsq.nInputCount  > PRIVATESEND_ENTRY_MAX_SIZE) return ;
6463
6564        masternode_info_t  infoMn;
6665        if (!mnodeman.GetMasternodeInfo (dsq.masternodeOutpoint , infoMn)) return ;
@@ -1035,16 +1034,10 @@ bool CPrivateSendClientSession::JoinExistingQueue(CAmount nBalanceNeedsAnonymize
10351034        std::vector<COutput> vCoinsTmp;
10361035        CAmount nMinAmount = vecStandardDenoms[vecBits.front ()];
10371036        CAmount nMaxAmount = nBalanceNeedsAnonymized;
1038-         //  nInputCount is not covered by legacy signature, require SPORK_6_NEW_SIGS to activate to use new algo
1039-         //  (to make sure nInputCount wasn't modified by some intermediary node)
1040-         bool  fNewAlgo  = infoMn.nProtocolVersion  > 70208  && sporkManager.IsSporkActive (SPORK_6_NEW_SIGS);
10411037
1042-         if  (fNewAlgo  && dsq.nInputCount  != 0 ) {
1043-             nMinAmount = nMaxAmount = dsq.nInputCount  * vecStandardDenoms[vecBits.front ()];
1044-         }
10451038        //  Try to match their denominations if possible, select exact number of denominations
10461039        if (!pwalletMain->SelectCoinsByDenominations (dsq.nDenom , nMinAmount, nMaxAmount, vecTxDSInTmp, vCoinsTmp, nValueInTmp, 0 , privateSendClient.nPrivateSendRounds )) {
1047-             LogPrintf (" CPrivateSendClientSession::JoinExistingQueue -- Couldn't match %d denominations %d %d  (%s)\n " , dsq. nInputCount , vecBits.front (), dsq.nDenom , CPrivateSend::GetDenominationsToString (dsq.nDenom ));
1040+             LogPrintf (" CPrivateSendClientSession::JoinExistingQueue -- Couldn't match %d denominations %d (%s)\n "  , vecBits.front (), dsq.nDenom , CPrivateSend::GetDenominationsToString (dsq.nDenom ));
10481041            continue ;
10491042        }
10501043
@@ -1056,15 +1049,14 @@ bool CPrivateSendClientSession::JoinExistingQueue(CAmount nBalanceNeedsAnonymize
10561049        }
10571050
10581051        nSessionDenom = dsq.nDenom ;
1059-         nSessionInputCount = fNewAlgo  ? dsq.nInputCount  : 0 ;
10601052        infoMixingMasternode = infoMn;
1061-         pendingDsaRequest = CPendingDsaRequest (infoMn.addr , CDarksendAccept (nSessionDenom, nSessionInputCount,  txMyCollateral));
1053+         pendingDsaRequest = CPendingDsaRequest (infoMn.addr , CDarksendAccept (nSessionDenom, txMyCollateral));
10621054        connman.AddPendingMasternode (infoMn.addr );
10631055        //  TODO: add new state POOL_STATE_CONNECTING and bump MIN_PRIVATESEND_PEER_PROTO_VERSION
10641056        SetState (POOL_STATE_QUEUE);
10651057        nTimeLastSuccessfulStep = GetTime ();
1066-         LogPrintf (" CPrivateSendClientSession::JoinExistingQueue -- pending connection (from queue): nSessionDenom: %d (%s), nSessionInputCount: %d,  addr=%s\n "  ,
1067-                   nSessionDenom, CPrivateSend::GetDenominationsToString (nSessionDenom), nSessionInputCount,  infoMn.addr .ToString ());
1058+         LogPrintf (" CPrivateSendClientSession::JoinExistingQueue -- pending connection (from queue): nSessionDenom: %d (%s), addr=%s\n "  ,
1059+                   nSessionDenom, CPrivateSend::GetDenominationsToString (nSessionDenom), infoMn.addr .ToString ());
10681060        strAutoDenomResult = _ (" Trying to connect..."  );
10691061        return  true ;
10701062    }
@@ -1132,37 +1124,14 @@ bool CPrivateSendClientSession::StartNewQueue(CAmount nValueMin, CAmount nBalanc
11321124            nSessionDenom = CPrivateSend::GetDenominationsByAmounts (vecAmounts);
11331125        }
11341126
1135-         //  Count available denominations.
1136-         //  Should never really fail after this point, since we just selected compatible inputs ourselves.
1137-         std::vector<int > vecBits;
1138-         if  (!CPrivateSend::GetDenominationsBits (nSessionDenom, vecBits)) {
1139-             return  false ;
1140-         }
1141- 
1142-         CAmount nValueInTmp = 0 ;
1143-         std::vector<CTxDSIn> vecTxDSInTmp;
1144-         std::vector<COutput> vCoinsTmp;
1145-         std::vector<CAmount> vecStandardDenoms = CPrivateSend::GetStandardDenominations ();
1146- 
1147-         bool  fSelected  = pwalletMain->SelectCoinsByDenominations (nSessionDenom, vecStandardDenoms[vecBits.front ()], vecStandardDenoms[vecBits.front ()] * PRIVATESEND_ENTRY_MAX_SIZE, vecTxDSInTmp, vCoinsTmp, nValueInTmp, 0 , privateSendClient.nPrivateSendRounds );
1148-         if  (!fSelected ) {
1149-             return  false ;
1150-         }
1151- 
1152-         //  nInputCount is not covered by legacy signature, require SPORK_6_NEW_SIGS to activate to use new algo
1153-         //  (to make sure nInputCount wasn't modified by some intermediary node)
1154-         bool  fNewAlgo  = infoMn.nProtocolVersion  > 70208  && sporkManager.IsSporkActive (SPORK_6_NEW_SIGS);
1155-         nSessionInputCount = fNewAlgo 
1156-                 ? std::min (vecTxDSInTmp.size (), size_t (5  + GetRand (PRIVATESEND_ENTRY_MAX_SIZE - 5  + 1 )))
1157-                 : 0 ;
11581127        infoMixingMasternode = infoMn;
11591128        connman.AddPendingMasternode (infoMn.addr );
1160-         pendingDsaRequest = CPendingDsaRequest (infoMn.addr , CDarksendAccept (nSessionDenom, nSessionInputCount,  txMyCollateral));
1129+         pendingDsaRequest = CPendingDsaRequest (infoMn.addr , CDarksendAccept (nSessionDenom, txMyCollateral));
11611130        //  TODO: add new state POOL_STATE_CONNECTING and bump MIN_PRIVATESEND_PEER_PROTO_VERSION
11621131        SetState (POOL_STATE_QUEUE);
11631132        nTimeLastSuccessfulStep = GetTime ();
1164-         LogPrintf (" CPrivateSendClientSession::StartNewQueue -- pending connection, nSessionDenom: %d (%s), nSessionInputCount: %d,  addr=%s\n "  ,
1165-                 nSessionDenom, CPrivateSend::GetDenominationsToString (nSessionDenom), nSessionInputCount,  infoMn.addr .ToString ());
1133+         LogPrintf (" CPrivateSendClientSession::StartNewQueue -- pending connection, nSessionDenom: %d (%s), addr=%s\n "  ,
1134+                 nSessionDenom, CPrivateSend::GetDenominationsToString (nSessionDenom), infoMn.addr .ToString ());
11661135        strAutoDenomResult = _ (" Trying to connect..."  );
11671136        return  true ;
11681137    }
@@ -1282,7 +1251,7 @@ bool CPrivateSendClientSession::PrepareDenominate(int nMinRounds, int nMaxRounds
12821251        return  false ;
12831252    }
12841253    std::vector<CAmount> vecStandardDenoms = CPrivateSend::GetStandardDenominations ();
1285-     bool  fSelected  = pwalletMain->SelectCoinsByDenominations (nSessionDenom, vecStandardDenoms[vecBits.front ()], vecStandardDenoms[vecBits. front ()] * PRIVATESEND_ENTRY_MAX_SIZE , vecTxDSIn, vCoins, nValueIn, nMinRounds, nMaxRounds);
1254+     bool  fSelected  = pwalletMain->SelectCoinsByDenominations (nSessionDenom, vecStandardDenoms[vecBits.front ()], CPrivateSend::GetMaxPoolAmount () , vecTxDSIn, vCoins, nValueIn, nMinRounds, nMaxRounds);
12861255    if  (nMinRounds >= 0  && !fSelected ) {
12871256        strErrorRet = " Can't select current denominated inputs"  ;
12881257        return  false ;
@@ -1303,7 +1272,7 @@ bool CPrivateSendClientSession::PrepareDenominate(int nMinRounds, int nMaxRounds
13031272    //  NOTE: No need to randomize order of inputs because they were
13041273    //  initially shuffled in CWallet::SelectCoinsByDenominations already.
13051274    int  nStep = 0 ;
1306-     int  nStepsMax = nSessionInputCount !=  0  ? nSessionInputCount : ( 5  + GetRandInt (PRIVATESEND_ENTRY_MAX_SIZE - 5  + 1 ) );
1275+     int  nStepsMax = 5  + GetRandInt (PRIVATESEND_ENTRY_MAX_SIZE - 5  + 1 );
13071276
13081277    while  (nStep < nStepsMax) {
13091278        for  (const  auto & nBit : vecBits) {
@@ -1350,7 +1319,7 @@ bool CPrivateSendClientSession::PrepareDenominate(int nMinRounds, int nMaxRounds
13501319        }
13511320    }
13521321
1353-     if  (CPrivateSend::GetDenominations (vecTxOutRet) != nSessionDenom || (nSessionInputCount !=  0  && vecTxOutRet. size () != ( size_t )nSessionInputCount) ) {
1322+     if  (CPrivateSend::GetDenominations (vecTxOutRet) != nSessionDenom) {
13541323        {
13551324            //  unlock used coins on failure
13561325            LOCK (pwalletMain->cs_wallet );
0 commit comments