Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recently introduced PS bugs #2330

Merged
merged 2 commits into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,15 +1083,15 @@ 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());
nTries++;
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",
Expand Down
9 changes: 8 additions & 1 deletion src/privatesend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ bool CDarkSendEntry::AddScriptSig(const CTxIn& txin)

uint256 CDarksendQueue::GetSignatureHash() const
{
return SerializeHash(*this);
// Remove after migration to 70211
{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for the braces / limiting scope here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it look really annoying so that we wouldn't forget about removing it later :D

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()
Expand Down
4 changes: 3 additions & 1 deletion src/privatesend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -183,6 +184,7 @@ class CDarksendQueue

CDarksendQueue() :
nDenom(0),
nInputCount(0),
masternodeOutpoint(COutPoint()),
nTime(0),
fReady(false),
Expand All @@ -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),
Expand All @@ -206,7 +209,6 @@ class CDarksendQueue
READWRITE(nDenom);
int nVersion = s.GetVersion();
if (nVersion > 70208 && nVersion <= 70210) {
int nInputCount = 0;
READWRITE(nInputCount);
}
READWRITE(masternodeOutpoint);
Expand Down