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.
1// Copyright (c) 2011-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_QT_SENDCOINSDIALOG_H6#define BITCOIN_QT_SENDCOINSDIALOG_H8#include <primitives/transaction_identifier.h>9#include <qt/clientmodel.h>10#include <qt/walletmodel.h>12#include <QDialog>13#include <QMessageBox>14#include <QString>15#include <QTimer>17class PlatformStyle;18class SendCoinsEntry;19class SendCoinsRecipient;20enum class SynchronizationState;21namespace wallet {22class CCoinControl;23} // namespace wallet25namespace Ui {26class SendCoinsDialog;27}29QT_BEGIN_NAMESPACE30class QUrl;31QT_END_NAMESPACE33/** Dialog for sending bitcoins */34class SendCoinsDialog : public QDialog35{36Q_OBJECT38public:39explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = nullptr);40~SendCoinsDialog();42void setClientModel(ClientModel *clientModel);43void setModel(WalletModel *model);45/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).46*/47QWidget *setupTabChain(QWidget *prev);49void setAddress(const QString &address);50void pasteEntry(const SendCoinsRecipient &rv);51bool handlePaymentRequest(const SendCoinsRecipient &recipient);53// Only used for testing-purposes54wallet::CCoinControl* getCoinControl() { return m_coin_control.get(); }56public Q_SLOTS:57void clear();58void reject() override;59void accept() override;60SendCoinsEntry *addEntry();61void updateTabsAndLabels();62void setBalance(const interfaces::WalletBalances& balances);64Q_SIGNALS:65void coinsSent(const Txid& txid);67private:68Ui::SendCoinsDialog *ui;69ClientModel* clientModel{nullptr};70WalletModel* model{nullptr};71std::unique_ptr<wallet::CCoinControl> m_coin_control;72std::unique_ptr<WalletModelTransaction> m_current_transaction;73bool fNewRecipientAllowed{true};74bool fFeeMinimized{true};75const PlatformStyle *platformStyle;77// Copy PSBT to clipboard and offer to save it.78void presentPSBT(PartiallySignedTransaction& psbt);79// Process WalletModel::SendCoinsReturn and generate a pair consisting80// of a message and message flags for use in Q_EMIT message().81// Additional parameter msgArg can be used via .arg(msgArg).82void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());83void minimizeFeeSection(bool fMinimize);84// Format confirmation message85bool PrepareSendText(QString& question_string, QString& informative_text, QString& detailed_text);86/* Sign PSBT using external signer.87*88* @param[in,out] psbtx the PSBT to sign89* @param[in,out] mtx needed to attempt to finalize90* @param[in,out] complete whether the PSBT is complete (a successfully signed multisig transaction may not be complete)91*92* @returns false if any failure occurred, which may include the user rejection of a transaction on the device.93*/94bool signWithExternalSigner(PartiallySignedTransaction& psbt, CMutableTransaction& mtx, bool& complete);95void updateFeeMinimizedLabel();96void updateCoinControlState();98private Q_SLOTS:99void sendButtonClicked(bool checked);100void on_buttonChooseFee_clicked();101void on_buttonMinimizeFee_clicked();102void removeEntry(SendCoinsEntry* entry);103void useAvailableBalance(SendCoinsEntry* entry);104void refreshBalance();105void coinControlFeatureChanged(bool);106void coinControlButtonClicked();107#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))108void coinControlChangeChecked(Qt::CheckState);109#else110void coinControlChangeChecked(int);111#endif112void coinControlChangeEdited(const QString &);113void coinControlUpdateLabels();114void coinControlClipboardQuantity();115void coinControlClipboardAmount();116void coinControlClipboardFee();117void coinControlClipboardAfterFee();118void coinControlClipboardBytes();119void coinControlClipboardChange();120void updateFeeSectionControls();121void updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state);122void updateSmartFeeLabel();124Q_SIGNALS:125// Fired when a message should be reported to the user126void message(const QString &title, const QString &message, unsigned int style);127};130#define SEND_CONFIRM_DELAY 3132class SendConfirmationDialog : public QMessageBox133{134Q_OBJECT136public:137SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text = "", const QString& detailed_text = "", int secDelay = SEND_CONFIRM_DELAY, bool enable_send = true, bool always_show_unsigned = true, QWidget* parent = nullptr);138/* Returns QMessageBox::Cancel, QMessageBox::Yes when "Send" is139clicked and QMessageBox::Save when "Create Unsigned" is clicked. */140int exec() override;142private Q_SLOTS:143void countDown();144void updateButtons();146private:147QAbstractButton *yesButton;148QAbstractButton *m_psbt_button;149QTimer countDownTimer;150int secDelay;151QString confirmButtonText{tr("Send")};152bool m_enable_send;153QString m_psbt_button_text{tr("Create Unsigned")};154};156#endif // BITCOIN_QT_SENDCOINSDIALOG_H
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.