Skip to content

Commit

Permalink
Fix qt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Jul 20, 2020
1 parent 05c886c commit 0a6b5c5
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,12 @@ void OverviewPage::privateSendStatus(bool fForce)
static int64_t nLastDSProgressBlockTime = 0;
int nBestHeight = clientModel->getNumBlocks();

CPrivateSendClientManager* privateSendClientManager = privateSendClientManagers.find(walletModel->getWallet()->GetName())->second;
auto it = privateSendClientManagers.find(walletModel->getWallet()->GetName());
if (it == privateSendClientManagers.end()) {
// nothing to do
return;
}
CPrivateSendClientManager* privateSendClientManager = it->second;

// We are processing more than 1 block per second, we'll just leave
if(nBestHeight > privateSendClientManager->nCachedNumBlocks && GetTime() - nLastDSProgressBlockTime <= 1) return;
Expand Down Expand Up @@ -605,7 +610,12 @@ void OverviewPage::togglePrivateSend(){
settings.setValue("hasMixed", "hasMixed");
}

CPrivateSendClientManager* privateSendClientManager = privateSendClientManagers.find(walletModel->getWallet()->GetName())->second;
auto it = privateSendClientManagers.find(walletModel->getWallet()->GetName());
if (it == privateSendClientManagers.end()) {
// nothing to do
return;
}
CPrivateSendClientManager* privateSendClientManager = it->second;

if (!privateSendClientManager->IsMixing()) {
const CAmount nMinAmount = CPrivateSend::GetSmallestDenomination() + CPrivateSend::GetMaxCollateralAmount();
Expand Down Expand Up @@ -671,5 +681,10 @@ void OverviewPage::DisablePrivateSendCompletely() {
if (nWalletBackups <= 0) {
ui->labelPrivateSendEnabled->setText("<span style='" + GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) + "'>(" + tr("Disabled") + ")</span>");
}
privateSendClientManagers.at(walletModel->getWallet()->GetName())->StopMixing();
auto it = privateSendClientManagers.find(walletModel->getWallet()->GetName());
if (it == privateSendClientManagers.end()) {
// nothing to do
return;
}
it->second->StopMixing();
}

0 comments on commit 0a6b5c5

Please sign in to comment.