Skip to content

Commit

Permalink
Base dsq/dstx thresholold on total number of up to date masternodes (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
UdjinM6 authored and codablock committed Nov 22, 2018
1 parent 5ffc31b commit 2b400f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/privatesend-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2b400f7

Please sign in to comment.