Base dsq/dstx thresholold on total number of up to date masternodes (#2465)

Mixing on a newer version with small number of upgraded masternodes
causes mixing txes to "stuck" - old nodes refuse to relay dstxes from new ones because
they come from the same masternodes too often. Basing threshold on the total number
of up to date masternodes and not only on a newer (enabled) ones should solve this.
This however will cause mixing to fail if there are not enough masternodes
on the needed protocol version (i.e. at least GetMinMasternodePaymentsProto())
but it's better to stop mixing than having funds kind of spent yet not confirmed
for a long time.
This commit is contained in:
UdjinM6 2018-11-22 08:09:35 +03:00 committed by Alexander Block
parent 5ffc31bce4
commit 2b400f74b5
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ void CPrivateSendClientManager::ProcessMessage(CNode* pfrom, const std::string&
}
}
int nThreshold = infoMn.nLastDsq + mnodeman.CountEnabled(MIN_PRIVATESEND_PEER_PROTO_VERSION) / 5;
int nThreshold = infoMn.nLastDsq + mnodeman.CountMasternodes() / 5;
LogPrint("privatesend", "DSQUEUE -- nLastDsq: %d threshold: %d nDsqCount: %d\n", infoMn.nLastDsq, nThreshold, mnodeman.nDsqCount);
//don't allow a few nodes to dominate the queuing process
if (infoMn.nLastDsq != 0 && nThreshold > mnodeman.nDsqCount) {

View File

@ -114,7 +114,7 @@ void CPrivateSendServer::ProcessMessage(CNode* pfrom, const std::string& strComm
}
}
int nThreshold = mnInfo.nLastDsq + mnodeman.CountEnabled(MIN_PRIVATESEND_PEER_PROTO_VERSION) / 5;
int nThreshold = mnInfo.nLastDsq + mnodeman.CountMasternodes() / 5;
LogPrint("privatesend", "DSQUEUE -- nLastDsq: %d threshold: %d nDsqCount: %d\n", mnInfo.nLastDsq, nThreshold, mnodeman.nDsqCount);
//don't allow a few nodes to dominate the queuing process
if (mnInfo.nLastDsq != 0 && nThreshold > mnodeman.nDsqCount) {