|
8 | 8 | #include "consensus/validation.h" |
9 | 9 | #include "core_io.h" |
10 | 10 | #include "init.h" |
| 11 | +#include "masternode-payments.h" |
11 | 12 | #include "masternode-sync.h" |
12 | 13 | #include "masternodeman.h" |
13 | 14 | #include "netmessagemaker.h" |
@@ -853,6 +854,12 @@ bool CPrivateSendClient::JoinExistingQueue(CAmount nBalanceNeedsAnonymized, CCon |
853 | 854 |
|
854 | 855 | if(infoMn.nProtocolVersion < MIN_PRIVATESEND_PEER_PROTO_VERSION) continue; |
855 | 856 |
|
| 857 | + // skip next mn payments winners |
| 858 | + if (mnpayments.IsScheduled(infoMn, 0)) { |
| 859 | + LogPrintf("CPrivateSendClient::JoinExistingQueue -- skipping winner, masternode=%s\n", infoMn.vin.prevout.ToStringShort()); |
| 860 | + continue; |
| 861 | + } |
| 862 | + |
856 | 863 | std::vector<int> vecBits; |
857 | 864 | if(!CPrivateSend::GetDenominationsBits(dsq.nDenom, vecBits)) { |
858 | 865 | // incompatible denom |
@@ -916,11 +923,20 @@ bool CPrivateSendClient::StartNewQueue(CAmount nValueMin, CAmount nBalanceNeedsA |
916 | 923 | // otherwise, try one randomly |
917 | 924 | while(nTries < 10) { |
918 | 925 | masternode_info_t infoMn = mnodeman.FindRandomNotInVec(vecMasternodesUsed, MIN_PRIVATESEND_PEER_PROTO_VERSION); |
| 926 | + |
919 | 927 | if(!infoMn.fInfoValid) { |
920 | 928 | LogPrintf("CPrivateSendClient::StartNewQueue -- Can't find random masternode!\n"); |
921 | 929 | strAutoDenomResult = _("Can't find random Masternode."); |
922 | 930 | return false; |
923 | 931 | } |
| 932 | + |
| 933 | + // skip next mn payments winners |
| 934 | + if (mnpayments.IsScheduled(infoMn, 0)) { |
| 935 | + LogPrintf("CPrivateSendClient::StartNewQueue -- skipping winner, masternode=%s\n", infoMn.vin.prevout.ToStringShort()); |
| 936 | + nTries++; |
| 937 | + continue; |
| 938 | + } |
| 939 | + |
924 | 940 | vecMasternodesUsed.push_back(infoMn.vin.prevout); |
925 | 941 |
|
926 | 942 | if(infoMn.nLastDsq != 0 && infoMn.nLastDsq + nMnCountEnabled/5 > mnodeman.nDsqCount) { |
|
0 commit comments