Skip to content

Commit

Permalink
Fix wallet lock check in DoAutomaticDenominating (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored Jul 28, 2018
1 parent 9643528 commit a83ab55
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,23 @@ bool CPrivateSendClient::DoAutomaticDenominating(CConnman& connman, bool fDryRun
{
if(fMasternodeMode) return false; // no client-side mixing on masternodes
if(!fEnablePrivateSend) return false;
if(!pwalletMain || pwalletMain->IsLocked(true)) return false;
if(nState != POOL_STATE_IDLE) return false;

if(!masternodeSync.IsMasternodeListSynced()) {
strAutoDenomResult = _("Can't mix while sync in progress.");
return false;
}

if (!pwalletMain) {
strAutoDenomResult = _("Wallet is not initialized");
return false;
}

if(!fDryRun && pwalletMain->IsLocked(true)) {
strAutoDenomResult = _("Wallet is locked.");
return false;
}

if(!CheckAutomaticBackup())
return false;

Expand All @@ -722,11 +731,6 @@ bool CPrivateSendClient::DoAutomaticDenominating(CConnman& connman, bool fDryRun
return false;
}

if(!fDryRun && pwalletMain->IsLocked(true)) {
strAutoDenomResult = _("Wallet is locked.");
return false;
}

if(WaitForAnotherBlock()) {
LogPrintf("CPrivateSendClient::DoAutomaticDenominating -- Last successful PrivateSend action was too recent\n");
strAutoDenomResult = _("Last successful PrivateSend action was too recent.");
Expand Down

0 comments on commit a83ab55

Please sign in to comment.