aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-04-25 17:00:58 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-04-25 17:06:56 +0300
commitc4571a0c39e08c7590bd6da5caebf695dfe028fe (patch)
tree73fc5eb97bcf1bd89ec4db4d9c87692feedc5860 /src
parent8f80092d78f758fdb2e79e2a832a0c7a26fa2da1 (diff)
parent5f438d66c1fbc0e524d12fef233f2ed2952e6f17 (diff)
Merge bitcoin-core/gui#284: refactor: Simplify SendCoinsDialog::updateCoinControlState
5f438d66c1fbc0e524d12fef233f2ed2952e6f17 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 5f438d66c1fbc0e524d12fef233f2ed2952e6f17, I have reviewed the code and it looks OK, I agree it can be merged. jonatack: Code review ACK 5f438d66c1fbc0e524d12fef233f2ed2952e6f17 kristapsk: utACK 5f438d66c1fbc0e524d12fef233f2ed2952e6f17. Code looks correct. Tree-SHA512: 14abaa3d561f8c8854fed989b6aca886dcca42135880bac76070043f61c0042ec8967f2b83e50bbbb82050ef0f074209e97fa300cb4dc51ee182316e0846506d
Diffstat (limited to 'src')
-rw-r--r--src/qt/sendcoinsdialog.cpp18
-rw-r--r--src/qt/sendcoinsdialog.h3
2 files changed, 10 insertions, 11 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index f0e720617c..c4e6d5973b 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -271,7 +271,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
m_current_transaction = std::make_unique<WalletModelTransaction>(recipients);
WalletModel::SendCoinsReturn prepareStatus;
- updateCoinControlState(*m_coin_control);
+ updateCoinControlState();
prepareStatus = model->prepareTransaction(*m_current_transaction, *m_coin_control);
@@ -740,19 +740,19 @@ void SendCoinsDialog::updateFeeMinimizedLabel()
}
}
-void SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl)
+void SendCoinsDialog::updateCoinControlState()
{
if (ui->radioCustomFee->isChecked()) {
- ctrl.m_feerate = CFeeRate(ui->customFee->value());
+ m_coin_control->m_feerate = CFeeRate(ui->customFee->value());
} else {
- ctrl.m_feerate.reset();
+ m_coin_control->m_feerate.reset();
}
// Avoid using global defaults when sending money from the GUI
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
- ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
- ctrl.m_signal_bip125_rbf = ui->optInRBF->isChecked();
+ m_coin_control->m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
+ m_coin_control->m_signal_bip125_rbf = ui->optInRBF->isChecked();
// Include watch-only for wallets without private key
- ctrl.fAllowWatchOnly = model->wallet().privateKeysDisabled();
+ m_coin_control->fAllowWatchOnly = model->wallet().privateKeysDisabled();
}
void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers, SynchronizationState sync_state) {
@@ -765,7 +765,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
{
if(!model || !model->getOptionsModel())
return;
- updateCoinControlState(*m_coin_control);
+ updateCoinControlState();
m_coin_control->m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels
int returned_target;
FeeReason reason;
@@ -928,7 +928,7 @@ void SendCoinsDialog::coinControlUpdateLabels()
if (!model || !model->getOptionsModel())
return;
- updateCoinControlState(*m_coin_control);
+ updateCoinControlState();
// set pay amounts
CoinControlDialog::payAmounts.clear();
diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h
index 3e276201ba..33736f8095 100644
--- a/src/qt/sendcoinsdialog.h
+++ b/src/qt/sendcoinsdialog.h
@@ -76,8 +76,7 @@ private:
// Format confirmation message
bool PrepareSendText(QString& question_string, QString& informative_text, QString& detailed_text);
void updateFeeMinimizedLabel();
- // Update the passed in CCoinControl with state from the GUI
- void updateCoinControlState(CCoinControl& ctrl);
+ void updateCoinControlState();
private Q_SLOTS:
void sendButtonClicked(bool checked);