Fix recent changes in DSA conditions (#2494)

* pr2487 bugfix

* push reject msg
This commit is contained in:
InhumanPerfection 2018-11-25 22:52:56 +02:00 committed by UdjinM6
parent 6480ad1d5f
commit bb11f1a638

View File

@ -50,24 +50,26 @@ void CPrivateSendServer::ProcessMessage(CNode* pfrom, const std::string& strComm
return; return;
} }
{ if (vecSessionCollaterals.size() == 0) {
TRY_LOCK(cs_vecqueue, lockRecv); {
if (!lockRecv) return; TRY_LOCK(cs_vecqueue, lockRecv);
if (!lockRecv) return;
for (const auto& q : vecPrivateSendQueue) { for (const auto& q : vecPrivateSendQueue) {
if (q.masternodeOutpoint == activeMasternodeInfo.outpoint) { if (q.masternodeOutpoint == activeMasternodeInfo.outpoint) {
// refuse to create another queue this often // refuse to create another queue this often
LogPrint("privatesend", "DSACCEPT -- last dsq is still in queue, refuse to mix\n"); LogPrint("privatesend", "DSACCEPT -- last dsq is still in queue, refuse to mix\n");
return; PushStatus(pfrom, STATUS_REJECTED, ERR_RECENT, connman);
return;
}
} }
} }
}
if (vecSessionCollaterals.size() == 0 && mnInfo.nLastDsq != 0 && if (mnInfo.nLastDsq != 0 && mnInfo.nLastDsq + mnodeman.CountMasternodes() / 5 > mnodeman.nDsqCount) {
mnInfo.nLastDsq + mnodeman.CountMasternodes() / 5 > mnodeman.nDsqCount) { LogPrintf("DSACCEPT -- last dsq too recent, must wait: addr=%s\n", pfrom->addr.ToString());
LogPrintf("DSACCEPT -- last dsq too recent, must wait: addr=%s\n", pfrom->addr.ToString()); PushStatus(pfrom, STATUS_REJECTED, ERR_RECENT, connman);
PushStatus(pfrom, STATUS_REJECTED, ERR_RECENT, connman); return;
return; }
} }
PoolMessage nMessageID = MSG_NOERR; PoolMessage nMessageID = MSG_NOERR;