GUI: sendCoinsDialog, remove duplicate wallet().getBalances() call

Inside setModel, we call 'wallet().getBalances()', to set the view balance,
right before calling 'updateDisplayUnit' which calls 'wallet().getBalances()'
internally and re-sets the view balance again.
24.x
furszy 3 years ago
parent a8098f2cef
commit e62958dc81
No known key found for this signature in database
GPG Key ID: 5DD23CCC686AA623

@ -164,11 +164,9 @@ void SendCoinsDialog::setModel(WalletModel *_model)
} }
} }
interfaces::WalletBalances balances = _model->wallet().getBalances();
setBalance(balances);
connect(_model, &WalletModel::balanceChanged, this, &SendCoinsDialog::setBalance); connect(_model, &WalletModel::balanceChanged, this, &SendCoinsDialog::setBalance);
connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::updateDisplayUnit); connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::refreshBalance);
updateDisplayUnit(); refreshBalance();
// Coin Control // Coin Control
connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::coinControlUpdateLabels); connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
@ -718,7 +716,7 @@ void SendCoinsDialog::setBalance(const interfaces::WalletBalances& balances)
} }
} }
void SendCoinsDialog::updateDisplayUnit() void SendCoinsDialog::refreshBalance()
{ {
setBalance(model->wallet().getBalances()); setBalance(model->wallet().getBalances());
ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());

@ -97,7 +97,7 @@ private Q_SLOTS:
void on_buttonMinimizeFee_clicked(); void on_buttonMinimizeFee_clicked();
void removeEntry(SendCoinsEntry* entry); void removeEntry(SendCoinsEntry* entry);
void useAvailableBalance(SendCoinsEntry* entry); void useAvailableBalance(SendCoinsEntry* entry);
void updateDisplayUnit(); void refreshBalance();
void coinControlFeatureChanged(bool); void coinControlFeatureChanged(bool);
void coinControlButtonClicked(); void coinControlButtonClicked();
void coinControlChangeChecked(int); void coinControlChangeChecked(int);

Loading…
Cancel
Save