MCPcopy Create free account
hub / github.com/ElementsProject/elements / processSendCoinsReturn

Method processSendCoinsReturn

src/qt/sendcoinsdialog.cpp:742–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740}
741
742void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg)
743{
744 QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams;
745 // Default to a warning message, override if error message is needed
746 msgParams.second = CClientUIInterface::MSG_WARNING;
747
748 // This comment is specific to SendCoinsDialog usage of WalletModel::SendCoinsReturn.
749 // All status values are used only in WalletModel::prepareTransaction()
750 switch(sendCoinsReturn.status)
751 {
752 case WalletModel::InvalidAddress:
753 msgParams.first = tr("The recipient address is not valid. Please recheck.");
754 break;
755 case WalletModel::InvalidAmount:
756 msgParams.first = tr("The amount to pay must be larger than 0.");
757 break;
758 case WalletModel::AmountExceedsBalance:
759 msgParams.first = tr("The amount exceeds your balance.");
760 break;
761 case WalletModel::AmountWithFeeExceedsBalance:
762 msgParams.first = tr("The total exceeds your balance when the %1 transaction fee is included.").arg(msgArg);
763 break;
764 case WalletModel::DuplicateAddress:
765 msgParams.first = tr("Duplicate address found: addresses should only be used once each.");
766 break;
767 case WalletModel::TransactionCreationFailed:
768 msgParams.first = tr("Transaction creation failed!");
769 msgParams.second = CClientUIInterface::MSG_ERROR;
770 break;
771 case WalletModel::AbsurdFee:
772 msgParams.first = tr("A fee higher than %1 is considered an absurdly high fee.").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), model->wallet().getDefaultMaxTxFee()));
773 break;
774 case WalletModel::PaymentRequestExpired:
775 msgParams.first = tr("Payment request expired.");
776 msgParams.second = CClientUIInterface::MSG_ERROR;
777 break;
778 // included to prevent a compiler warning.
779 case WalletModel::OK:
780 default:
781 return;
782 }
783
784 Q_EMIT message(tr("Send Coins"), msgParams.first, msgParams.second);
785}
786
787void SendCoinsDialog::minimizeFeeSection(bool fMinimize)
788{

Callers

nothing calls this directly

Calls 4

getDisplayUnitMethod · 0.80
getDefaultMaxTxFeeMethod · 0.80
getOptionsModelMethod · 0.45
walletMethod · 0.45

Tested by

no test coverage detected