Skip to content
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
3 changes: 2 additions & 1 deletion src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ void OverviewPage::setBalance(
ui->labelUnconfirmedPrivate->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedPrivateBalance, false, BitcoinUnits::separatorAlways));
ui->labelAnonymizable->setText(BitcoinUnits::formatWithUnit(unit, anonymizableBalance, false, BitcoinUnits::separatorAlways));

ui->anonymizeButton->setEnabled(spark::IsSparkAllowed() && anonymizableBalance > 0);
auto wallet = walletModel->getWallet();
ui->anonymizeButton->setEnabled(wallet && wallet->sparkWallet && spark::IsSparkAllowed() && anonymizableBalance > 0);

// only show immature (newly mined) balance if it's non-zero, so as not to complicate things
// for the non-mining users
Expand Down
9 changes: 8 additions & 1 deletion src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
tableView->horizontalHeader()->setMinimumSectionSize(23);
tableView->horizontalHeader()->setStretchLastSection(true);

auto wallet = _model->getWallet();
if (!wallet || !wallet->sparkWallet) {
ui->addressTypeCombobox->removeItem(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumes item 0 is always “Spark”. Is this a correct assumption? ( I am not sure, just asking ).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, item 0 at this point is always "Spark"

ui->reuseAddress->show();
ui->createSparkNameButton->setVisible(false);
}

connect(tableView->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &ReceiveCoinsDialog::recentRequestsView_selectionChanged);
}
Expand Down Expand Up @@ -327,7 +334,7 @@ void ReceiveCoinsDialog::copyAmount()

void ReceiveCoinsDialog::displayCheckBox(int idx)
{
if(idx==0){
if(ui->addressTypeCombobox->currentText() == tr("Spark")){
ui->reuseAddress->hide();
ui->createSparkNameButton->setVisible(true);
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ void WalletView::requestedSyncWarningInfo()
void WalletView::showAutomintSparkNotification()
{
auto sparkModel = walletModel->getSparkModel();
if (!sparkModel) {
auto wallet = walletModel->getWallet();
if (!sparkModel || !wallet || !wallet->sparkWallet) {
return;
}

Expand Down
Loading