Skip to content

Commit c4571a0

Browse files
committed
Merge bitcoin-core#284: refactor: Simplify SendCoinsDialog::updateCoinControlState
5f438d6 refactor, qt: Simplify SendCoinsDialog::updateCoinControlState (João Barbosa) Pull request description: This PR doesn't change behaviour, removes the coin control argument from `updateCoinControlState` since it's a class member. ACKs for top commit: hebasto: ACK 5f438d6, I have reviewed the code and it looks OK, I agree it can be merged. jonatack: Code review ACK 5f438d6 kristapsk: utACK 5f438d6. Code looks correct. Tree-SHA512: 14abaa3d561f8c8854fed989b6aca886dcca42135880bac76070043f61c0042ec8967f2b83e50bbbb82050ef0f074209e97fa300cb4dc51ee182316e0846506d
2 parents 8f80092 + 5f438d6 commit c4571a0

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
271271
m_current_transaction = std::make_unique<WalletModelTransaction>(recipients);
272272
WalletModel::SendCoinsReturn prepareStatus;
273273

274-
updateCoinControlState(*m_coin_control);
274+
updateCoinControlState();
275275

276276
prepareStatus = model->prepareTransaction(*m_current_transaction, *m_coin_control);
277277

@@ -740,19 +740,19 @@ void SendCoinsDialog::updateFeeMinimizedLabel()
740740
}
741741
}
742742

743-
void SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl)
743+
void SendCoinsDialog::updateCoinControlState()
744744
{
745745
if (ui->radioCustomFee->isChecked()) {
746-
ctrl.m_feerate = CFeeRate(ui->customFee->value());
746+
m_coin_control->m_feerate = CFeeRate(ui->customFee->value());
747747
} else {
748-
ctrl.m_feerate.reset();
748+
m_coin_control->m_feerate.reset();
749749
}
750750
// Avoid using global defaults when sending money from the GUI
751751
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
752-
ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
753-
ctrl.m_signal_bip125_rbf = ui->optInRBF->isChecked();
752+
m_coin_control->m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
753+
m_coin_control->m_signal_bip125_rbf = ui->optInRBF->isChecked();
754754
// Include watch-only for wallets without private key
755-
ctrl.fAllowWatchOnly = model->wallet().privateKeysDisabled();
755+
m_coin_control->fAllowWatchOnly = model->wallet().privateKeysDisabled();
756756
}
757757

758758
void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers, SynchronizationState sync_state) {
@@ -765,7 +765,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
765765
{
766766
if(!model || !model->getOptionsModel())
767767
return;
768-
updateCoinControlState(*m_coin_control);
768+
updateCoinControlState();
769769
m_coin_control->m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels
770770
int returned_target;
771771
FeeReason reason;
@@ -928,7 +928,7 @@ void SendCoinsDialog::coinControlUpdateLabels()
928928
if (!model || !model->getOptionsModel())
929929
return;
930930

931-
updateCoinControlState(*m_coin_control);
931+
updateCoinControlState();
932932

933933
// set pay amounts
934934
CoinControlDialog::payAmounts.clear();

src/qt/sendcoinsdialog.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ public Q_SLOTS:
7676
// Format confirmation message
7777
bool PrepareSendText(QString& question_string, QString& informative_text, QString& detailed_text);
7878
void updateFeeMinimizedLabel();
79-
// Update the passed in CCoinControl with state from the GUI
80-
void updateCoinControlState(CCoinControl& ctrl);
79+
void updateCoinControlState();
8180

8281
private Q_SLOTS:
8382
void sendButtonClicked(bool checked);

0 commit comments

Comments
 (0)