Skip to content

Commit a83ab55

Browse files
authored
Fix wallet lock check in DoAutomaticDenominating (#2196)
1 parent 9643528 commit a83ab55

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/privatesend-client.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -700,14 +700,23 @@ bool CPrivateSendClient::DoAutomaticDenominating(CConnman& connman, bool fDryRun
700700
{
701701
if(fMasternodeMode) return false; // no client-side mixing on masternodes
702702
if(!fEnablePrivateSend) return false;
703-
if(!pwalletMain || pwalletMain->IsLocked(true)) return false;
704703
if(nState != POOL_STATE_IDLE) return false;
705704

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

710+
if (!pwalletMain) {
711+
strAutoDenomResult = _("Wallet is not initialized");
712+
return false;
713+
}
714+
715+
if(!fDryRun && pwalletMain->IsLocked(true)) {
716+
strAutoDenomResult = _("Wallet is locked.");
717+
return false;
718+
}
719+
711720
if(!CheckAutomaticBackup())
712721
return false;
713722

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

725-
if(!fDryRun && pwalletMain->IsLocked(true)) {
726-
strAutoDenomResult = _("Wallet is locked.");
727-
return false;
728-
}
729-
730734
if(WaitForAnotherBlock()) {
731735
LogPrintf("CPrivateSendClient::DoAutomaticDenominating -- Last successful PrivateSend action was too recent\n");
732736
strAutoDenomResult = _("Last successful PrivateSend action was too recent.");

0 commit comments

Comments
 (0)