From ca2c83da50a2665f238432834c0246f52b5e234c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 14 Dec 2013 12:30:08 +0100 Subject: 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. --- src/qt/bitcoin.cpp | 17 ----------------- src/qt/bitcoingui.cpp | 13 ------------- src/qt/bitcoingui.h | 10 ---------- 3 files changed, 40 deletions(-) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 2b3bf3bfb5..67385588e0 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -74,22 +74,6 @@ static bool ThreadSafeMessageBox(const std::string& message, const std::string& } } -static bool ThreadSafeAskFee(int64_t nFeeRequired) -{ - if(!guiref) - return false; - if(nFeeRequired < CTransaction::nMinTxFee || nFeeRequired <= nTransactionFee || fDaemon) - return true; - - bool payFee = false; - - QMetaObject::invokeMethod(guiref, "askFee", GUIUtil::blockingGUIThreadConnection(), - Q_ARG(qint64, nFeeRequired), - Q_ARG(bool*, &payFee)); - - return payFee; -} - static void InitMessage(const std::string &message) { if(splashref) @@ -262,7 +246,6 @@ int main(int argc, char *argv[]) // Subscribe to global signals from core uiInterface.ThreadSafeMessageBox.connect(ThreadSafeMessageBox); - uiInterface.ThreadSafeAskFee.connect(ThreadSafeAskFee); uiInterface.InitMessage.connect(InitMessage); uiInterface.Translate.connect(Translate); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index b1daba5cba..180c44ad59 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -726,19 +726,6 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) QMainWindow::closeEvent(event); } -void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee) -{ - if (!clientModel || !clientModel->getOptionsModel()) - return; - - QString strMessage = tr("This transaction is over the size limit. You can still send it for a fee of %1, " - "which goes to the nodes that process your transaction and helps to support the network. " - "Do you want to pay the fee?").arg(BitcoinUnits::formatWithUnit(clientModel->getOptionsModel()->getDisplayUnit(), nFeeRequired)); - QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm transaction fee"), strMessage, - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes); - *payFee = (retval == QMessageBox::Yes); -} - void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address) { // On new transaction, make an info balloon diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index b9a8a03139..75c61d2a8a 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -135,16 +135,6 @@ public slots: */ void message(const QString &title, const QString &message, unsigned int style, bool *ret = NULL); - /** Asks the user whether to pay the transaction fee or to cancel the transaction. - It is currently not possible to pass a return value to another thread through - BlockingQueuedConnection, so an indirected pointer is used. - https://bugreports.qt-project.org/browse/QTBUG-10440 - - @param[in] nFeeRequired the required fee - @param[out] payFee true to pay the fee, false to not pay the fee - */ - void askFee(qint64 nFeeRequired, bool *payFee); - bool handlePaymentRequest(const SendCoinsRecipient& recipient); /** Show incoming transaction notification for new transactions. */ -- cgit v1.2.3 From 4a61c39456b553f7de8ccc019276d40aff10dac0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 16 Dec 2013 09:46:55 +0100 Subject: qt: status WalletModel::Aborted is no longer used Aborting transactions happens in the GUI now as it should, not the backend. --- src/qt/sendcoinsdialog.cpp | 3 +-- src/qt/walletmodel.h | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/qt') diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 03cf7f51ea..4bf5c3c479 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -452,9 +452,8 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn 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."); msgParams.second = CClientUIInterface::MSG_ERROR; break; - // OK and Aborted are included to prevent a compiler warning. + // included to prevent a compiler warning. case WalletModel::OK: - case WalletModel::Aborted: default: return; } diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 44a1912ecc..642021df1a 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -75,8 +75,7 @@ public: AmountWithFeeExceedsBalance, DuplicateAddress, TransactionCreationFailed, // Error returned when wallet is still locked - TransactionCommitFailed, - Aborted + TransactionCommitFailed }; enum EncryptionStatus @@ -103,7 +102,7 @@ public: // Return status record for SendCoins, contains error id + information struct SendCoinsReturn { - SendCoinsReturn(StatusCode status = Aborted): + SendCoinsReturn(StatusCode status = OK): status(status) {} StatusCode status; }; -- cgit v1.2.3