mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-23 10:23:27 +02:00
refactor, qt: Simplify SendCoinsDialog::updateCoinControlState
This commit is contained in:
parent
0dd7b23489
commit
5f438d66c1
@ -271,7 +271,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
|
|||||||
m_current_transaction = std::make_unique<WalletModelTransaction>(recipients);
|
m_current_transaction = std::make_unique<WalletModelTransaction>(recipients);
|
||||||
WalletModel::SendCoinsReturn prepareStatus;
|
WalletModel::SendCoinsReturn prepareStatus;
|
||||||
|
|
||||||
updateCoinControlState(*m_coin_control);
|
updateCoinControlState();
|
||||||
|
|
||||||
prepareStatus = model->prepareTransaction(*m_current_transaction, *m_coin_control);
|
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()) {
|
if (ui->radioCustomFee->isChecked()) {
|
||||||
ctrl.m_feerate = CFeeRate(ui->customFee->value());
|
m_coin_control->m_feerate = CFeeRate(ui->customFee->value());
|
||||||
} else {
|
} else {
|
||||||
ctrl.m_feerate.reset();
|
m_coin_control->m_feerate.reset();
|
||||||
}
|
}
|
||||||
// Avoid using global defaults when sending money from the GUI
|
// 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
|
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
|
||||||
ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
|
m_coin_control->m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
|
||||||
ctrl.m_signal_bip125_rbf = ui->optInRBF->isChecked();
|
m_coin_control->m_signal_bip125_rbf = ui->optInRBF->isChecked();
|
||||||
// Include watch-only for wallets without private key
|
// 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) {
|
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())
|
if(!model || !model->getOptionsModel())
|
||||||
return;
|
return;
|
||||||
updateCoinControlState(*m_coin_control);
|
updateCoinControlState();
|
||||||
m_coin_control->m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels
|
m_coin_control->m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels
|
||||||
int returned_target;
|
int returned_target;
|
||||||
FeeReason reason;
|
FeeReason reason;
|
||||||
@ -928,7 +928,7 @@ void SendCoinsDialog::coinControlUpdateLabels()
|
|||||||
if (!model || !model->getOptionsModel())
|
if (!model || !model->getOptionsModel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateCoinControlState(*m_coin_control);
|
updateCoinControlState();
|
||||||
|
|
||||||
// set pay amounts
|
// set pay amounts
|
||||||
CoinControlDialog::payAmounts.clear();
|
CoinControlDialog::payAmounts.clear();
|
||||||
|
@ -76,8 +76,7 @@ private:
|
|||||||
// Format confirmation message
|
// Format confirmation message
|
||||||
bool PrepareSendText(QString& question_string, QString& informative_text, QString& detailed_text);
|
bool PrepareSendText(QString& question_string, QString& informative_text, QString& detailed_text);
|
||||||
void updateFeeMinimizedLabel();
|
void updateFeeMinimizedLabel();
|
||||||
// Update the passed in CCoinControl with state from the GUI
|
void updateCoinControlState();
|
||||||
void updateCoinControlState(CCoinControl& ctrl);
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void sendButtonClicked(bool checked);
|
void sendButtonClicked(bool checked);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user