Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1001if (!model || !model->getOptionsModel())1002return;1004updateCoinControlState();1006// set pay amounts1007CoinControlDialog::payAmounts.clear();1008CoinControlDialog::fSubtractFeeFromAmount = false;1010for(int i = 0; i < ui->entries->count(); ++i)1011{1012SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());1013if(entry && !entry->isHidden())1014{1015SendCoinsRecipient rcp = entry->getValue();1016CoinControlDialog::payAmounts.append(rcp.amount);1017if (rcp.fSubtractFeeFromAmount)1018CoinControlDialog::fSubtractFeeFromAmount = true;1019}1020}1022if (m_coin_control->HasSelected())1023{1024// actual coin control calculation1025CoinControlDialog::updateLabels(*m_coin_control, model, this);1027// show coin control stats1028ui->labelCoinControlAutomaticallySelected->hide();1029ui->widgetCoinControl->show();1030}1031else1032{1033// hide coin control stats1034ui->labelCoinControlAutomaticallySelected->show();1035ui->widgetCoinControl->hide();1036ui->labelCoinControlInsuffFunds->hide();1037}1038}1040SendConfirmationDialog::SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text, const QString& detailed_text, int _secDelay, bool enable_send, bool always_show_unsigned, QWidget* parent)1041: QMessageBox(parent), secDelay(_secDelay), m_enable_send(enable_send)1042{1043setIcon(QMessageBox::Question);1044setWindowTitle(title); // On macOS, the window title is ignored (as required by the macOS Guidelines).1045setText(text);1046setInformativeText(informative_text);1047setDetailedText(detailed_text);1048setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);1049if (always_show_unsigned || !enable_send) addButton(QMessageBox::Save);1050setDefaultButton(QMessageBox::Cancel);1051yesButton = button(QMessageBox::Yes);1052if (confirmButtonText.isEmpty()) {1053confirmButtonText = yesButton->text();1054}1055m_psbt_button = button(QMessageBox::Save);1056updateButtons();1057connect(&countDownTimer, &QTimer::timeout, this, &SendConfirmationDialog::countDown);1058}1060int SendConfirmationDialog::exec()1061{1062updateButtons();1063countDownTimer.start(1s);1064return QMessageBox::exec();1065}1067void SendConfirmationDialog::countDown()1068{1069secDelay--;1070updateButtons();1072if(secDelay <= 0)1073{1074countDownTimer.stop();1075}1076}1078void SendConfirmationDialog::updateButtons()1079{1080if(secDelay > 0)1081{1082yesButton->setEnabled(false);1083yesButton->setText(confirmButtonText + (m_enable_send ? (" (" + QString::number(secDelay) + ")") : QString("")));1084if (m_psbt_button) {1085m_psbt_button->setEnabled(false);1086m_psbt_button->setText(m_psbt_button_text + " (" + QString::number(secDelay) + ")");1087}1088}1089else1090{1091yesButton->setEnabled(m_enable_send);1092yesButton->setText(confirmButtonText);1093if (m_psbt_button) {1094m_psbt_button->setEnabled(true);1095m_psbt_button->setText(m_psbt_button_text);1096}1097}1098}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.