diff --git a/src/privatesend-client.cpp b/src/privatesend-client.cpp index f0bd2a6dec4ba..48ef4decec7b2 100644 --- a/src/privatesend-client.cpp +++ b/src/privatesend-client.cpp @@ -1083,6 +1083,8 @@ bool CPrivateSendClientSession::StartNewQueue(CAmount nValueMin, CAmount nBalanc return false; } + privateSendClient.AddUsedMasternode(infoMn.outpoint); + // skip next mn payments winners if (mnpayments.IsScheduled(infoMn, 0)) { LogPrintf("CPrivateSendClientSession::StartNewQueue -- skipping winner, masternode=%s\n", infoMn.outpoint.ToStringShort()); @@ -1090,8 +1092,6 @@ bool CPrivateSendClientSession::StartNewQueue(CAmount nValueMin, CAmount nBalanc continue; } - privateSendClient.AddUsedMasternode(infoMn.outpoint); - if(infoMn.nLastDsq != 0 && infoMn.nLastDsq + nMnCountEnabled/5 > mnodeman.nDsqCount) { LogPrintf("CPrivateSendClientSession::StartNewQueue -- Too early to mix on this masternode!" " masternode=%s addr=%s nLastDsq=%d CountEnabled/5=%d nDsqCount=%d\n", diff --git a/src/privatesend.cpp b/src/privatesend.cpp index ab0d4978d0938..0e3c3bf670b39 100644 --- a/src/privatesend.cpp +++ b/src/privatesend.cpp @@ -35,7 +35,14 @@ bool CDarkSendEntry::AddScriptSig(const CTxIn& txin) uint256 CDarksendQueue::GetSignatureHash() const { - return SerializeHash(*this); + // Remove after migration to 70211 + { + masternode_info_t mnInfo; + mnodeman.GetMasternodeInfo(masternodeOutpoint, mnInfo); + return SerializeHash(*this, SER_GETHASH, mnInfo.nProtocolVersion); + } + // END remove, replace with the code below + // return SerializeHash(*this); } bool CDarksendQueue::Sign() diff --git a/src/privatesend.h b/src/privatesend.h index 14636f5c6fbcc..b505c7fbc15a6 100644 --- a/src/privatesend.h +++ b/src/privatesend.h @@ -174,6 +174,7 @@ class CDarksendQueue { public: int nDenom; + int nInputCount; // not used for anything but to calculate correct hash, remove after migration to 70211 COutPoint masternodeOutpoint; int64_t nTime; bool fReady; //ready for submit @@ -183,6 +184,7 @@ class CDarksendQueue CDarksendQueue() : nDenom(0), + nInputCount(0), masternodeOutpoint(COutPoint()), nTime(0), fReady(false), @@ -192,6 +194,7 @@ class CDarksendQueue CDarksendQueue(int nDenom, COutPoint outpoint, int64_t nTime, bool fReady) : nDenom(nDenom), + nInputCount(0), masternodeOutpoint(outpoint), nTime(nTime), fReady(fReady), @@ -206,7 +209,6 @@ class CDarksendQueue READWRITE(nDenom); int nVersion = s.GetVersion(); if (nVersion > 70208 && nVersion <= 70210) { - int nInputCount = 0; READWRITE(nInputCount); } READWRITE(masternodeOutpoint);