Skip to content

Commit ca2c83d

Browse files
committed
Remove unused ThreadSafeAskFee from ui_interface
ThreadSafeAskFee is effectively unused. It is only called when the fAskFee parameter on SendMoney or SendMoneyToDestination is true, which never happens. Remove it.
1 parent 37e67d3 commit ca2c83d

File tree

5 files changed

+5
-48
lines changed

5 files changed

+5
-48
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/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)