Skip to content

Commit 57fdd68

Browse files
committed
Merge pull request #3415
4a61c39 qt: status WalletModel::Aborted is no longer used (Wladimir J. van der Laan) ca2c83d Remove unused ThreadSafeAskFee from ui_interface (Wladimir J. van der Laan) 37e67d3 Remove unused ThreadSafeHandleURI from ui_interface (Wladimir J. van der Laan)
2 parents 03d9dd4 + 4a61c39 commit 57fdd68

File tree

8 files changed

+8
-56
lines changed

8 files changed

+8
-56
lines changed

src/qt/bitcoin.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,6 @@ static bool ThreadSafeMessageBox(const std::string& message, const std::string&
7474
}
7575
}
7676

77-
static bool ThreadSafeAskFee(int64_t nFeeRequired)
78-
{
79-
if(!guiref)
80-
return false;
81-
if(nFeeRequired < CTransaction::nMinTxFee || nFeeRequired <= nTransactionFee || fDaemon)
82-
return true;
83-
84-
bool payFee = false;
85-
86-
QMetaObject::invokeMethod(guiref, "askFee", GUIUtil::blockingGUIThreadConnection(),
87-
Q_ARG(qint64, nFeeRequired),
88-
Q_ARG(bool*, &payFee));
89-
90-
return payFee;
91-
}
92-
9377
static void InitMessage(const std::string &message)
9478
{
9579
if(splashref)
@@ -262,7 +246,6 @@ int main(int argc, char *argv[])
262246

263247
// Subscribe to global signals from core
264248
uiInterface.ThreadSafeMessageBox.connect(ThreadSafeMessageBox);
265-
uiInterface.ThreadSafeAskFee.connect(ThreadSafeAskFee);
266249
uiInterface.InitMessage.connect(InitMessage);
267250
uiInterface.Translate.connect(Translate);
268251

src/qt/bitcoingui.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -726,19 +726,6 @@ void BitcoinGUI::closeEvent(QCloseEvent *event)
726726
QMainWindow::closeEvent(event);
727727
}
728728

729-
void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
730-
{
731-
if (!clientModel || !clientModel->getOptionsModel())
732-
return;
733-
734-
QString strMessage = tr("This transaction is over the size limit. You can still send it for a fee of %1, "
735-
"which goes to the nodes that process your transaction and helps to support the network. "
736-
"Do you want to pay the fee?").arg(BitcoinUnits::formatWithUnit(clientModel->getOptionsModel()->getDisplayUnit(), nFeeRequired));
737-
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm transaction fee"), strMessage,
738-
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
739-
*payFee = (retval == QMessageBox::Yes);
740-
}
741-
742729
void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address)
743730
{
744731
// On new transaction, make an info balloon

src/qt/bitcoingui.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,6 @@ public slots:
135135
*/
136136
void message(const QString &title, const QString &message, unsigned int style, bool *ret = NULL);
137137

138-
/** Asks the user whether to pay the transaction fee or to cancel the transaction.
139-
It is currently not possible to pass a return value to another thread through
140-
BlockingQueuedConnection, so an indirected pointer is used.
141-
https://bugreports.qt-project.org/browse/QTBUG-10440
142-
143-
@param[in] nFeeRequired the required fee
144-
@param[out] payFee true to pay the fee, false to not pay the fee
145-
*/
146-
void askFee(qint64 nFeeRequired, bool *payFee);
147-
148138
bool handlePaymentRequest(const SendCoinsRecipient& recipient);
149139

150140
/** Show incoming transaction notification for new transactions. */

src/qt/sendcoinsdialog.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,8 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn
452452
msgParams.first = tr("The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
453453
msgParams.second = CClientUIInterface::MSG_ERROR;
454454
break;
455-
// OK and Aborted are included to prevent a compiler warning.
455+
// included to prevent a compiler warning.
456456
case WalletModel::OK:
457-
case WalletModel::Aborted:
458457
default:
459458
return;
460459
}

src/qt/walletmodel.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class WalletModel : public QObject
7575
AmountWithFeeExceedsBalance,
7676
DuplicateAddress,
7777
TransactionCreationFailed, // Error returned when wallet is still locked
78-
TransactionCommitFailed,
79-
Aborted
78+
TransactionCommitFailed
8079
};
8180

8281
enum EncryptionStatus
@@ -103,7 +102,7 @@ class WalletModel : public QObject
103102
// Return status record for SendCoins, contains error id + information
104103
struct SendCoinsReturn
105104
{
106-
SendCoinsReturn(StatusCode status = Aborted):
105+
SendCoinsReturn(StatusCode status = OK):
107106
status(status) {}
108107
StatusCode status;
109108
};

src/ui_interface.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ class CClientUIInterface
7575
/** Ask the user whether they want to pay a fee or not. */
7676
boost::signals2::signal<bool (int64_t nFeeRequired), boost::signals2::last_value<bool> > ThreadSafeAskFee;
7777

78-
/** Handle a URL passed at the command line. */
79-
boost::signals2::signal<void (const std::string& strURI)> ThreadSafeHandleURI;
80-
8178
/** Progress message during initialization. */
8279
boost::signals2::signal<void (const std::string &message)> InitMessage;
8380

src/wallet.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
14341434

14351435

14361436

1437-
string CWallet::SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew, bool fAskFee)
1437+
string CWallet::SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew)
14381438
{
14391439
CReserveKey reservekey(this);
14401440
int64_t nFeeRequired;
@@ -1454,9 +1454,6 @@ string CWallet::SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNe
14541454
return strError;
14551455
}
14561456

1457-
if (fAskFee && !uiInterface.ThreadSafeAskFee(nFeeRequired))
1458-
return "ABORTED";
1459-
14601457
if (!CommitTransaction(wtxNew, reservekey))
14611458
return _("Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
14621459

@@ -1465,7 +1462,7 @@ string CWallet::SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNe
14651462

14661463

14671464

1468-
string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nValue, CWalletTx& wtxNew, bool fAskFee)
1465+
string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nValue, CWalletTx& wtxNew)
14691466
{
14701467
// Check amount
14711468
if (nValue <= 0)
@@ -1477,7 +1474,7 @@ string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nV
14771474
CScript scriptPubKey;
14781475
scriptPubKey.SetDestination(address);
14791476

1480-
return SendMoney(scriptPubKey, nValue, wtxNew, fAskFee);
1477+
return SendMoney(scriptPubKey, nValue, wtxNew);
14811478
}
14821479

14831480

src/wallet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ class CWallet : public CCryptoKeyStore, public CWalletInterface
217217
bool CreateTransaction(CScript scriptPubKey, int64_t nValue,
218218
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL);
219219
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
220-
std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew, bool fAskFee=false);
221-
std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew, bool fAskFee=false);
220+
std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew);
221+
std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew);
222222

223223
bool NewKeyPool();
224224
bool TopUpKeyPool(unsigned int kpSize = 0);

0 commit comments

Comments
 (0)