Skip to content

Commit 2b76f31

Browse files
committed
Only enable/disable PrivacyDialog zPIV elements if needed.
Currently the zPIV buttons are constantly updated to enabled or disabled even if they are already in the correct state.
1 parent 766d519 commit 2b76f31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/qt/privacydialog.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,16 +791,17 @@ void PrivacyDialog::updateAutomintStatus()
791791
void PrivacyDialog::updateSPORK16Status()
792792
{
793793
// Update/enable labels, buttons and tooltips depending on the current SPORK_16 status
794-
if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) {
794+
bool fButtonsEnabled = ui->pushButtonMintzPIV->isEnabled();
795+
bool fMaintenanceMode = GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE);
796+
if (fMaintenanceMode && fButtonsEnabled) {
795797
// Mint zPIV
796798
ui->pushButtonMintzPIV->setEnabled(false);
797799
ui->pushButtonMintzPIV->setToolTip(tr("zPIV is currently disabled due to maintenance."));
798800

799801
// Spend zPIV
800802
ui->pushButtonSpendzPIV->setEnabled(false);
801803
ui->pushButtonSpendzPIV->setToolTip(tr("zPIV is currently disabled due to maintenance."));
802-
}
803-
else {
804+
} else if (!fMaintenanceMode && !fButtonsEnabled) {
804805
// Mint zPIV
805806
ui->pushButtonMintzPIV->setEnabled(true);
806807
ui->pushButtonMintzPIV->setToolTip(tr("PrivacyDialog", "Enter an amount of PIV to convert to zPIV", 0));

0 commit comments

Comments
 (0)