diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-05-07 10:54:11 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-08-12 13:05:47 -0300 |
commit | e62958dc81d215a1c56318d0914dfd9a33d45973 (patch) | |
tree | 168b791c0a6e6123a7ae273a4f44c9410ecbee10 /src/qt/sendcoinsdialog.cpp | |
parent | a8098f2cef53ec003edae91100afce564e9c6f23 (diff) | |
download | bitcoin-e62958dc81d215a1c56318d0914dfd9a33d45973.tar.xz |
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.
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index fd8eccb86d..91d2233ff5 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -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->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::updateDisplayUnit); - updateDisplayUnit(); + connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::refreshBalance); + refreshBalance(); // Coin Control 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()); ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); |