merge bitcoin-core/gui#280: Remove user input from URI error message

This commit is contained in:
Kittywhiskers Van Gogh 2021-04-14 01:21:49 +05:30
parent a3ac6941a7
commit 09a8fc1df9
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -233,14 +233,17 @@ void PaymentServer::handleURIOrFile(const QString& s)
SendCoinsRecipient recipient; SendCoinsRecipient recipient;
if (GUIUtil::parseBitcoinURI(s, &recipient)) if (GUIUtil::parseBitcoinURI(s, &recipient))
{ {
if (!IsValidDestinationString(recipient.address.toStdString())) { std::string error_msg;
const CTxDestination dest = DecodeDestination(recipient.address.toStdString(), error_msg);
if (!IsValidDestination(dest)) {
if (uri.hasQueryItem("r")) { // payment request if (uri.hasQueryItem("r")) { // payment request
Q_EMIT message(tr("URI handling"), Q_EMIT message(tr("URI handling"),
tr("Cannot process payment request as BIP70 is no longer supported.")+ tr("Cannot process payment request as BIP70 is no longer supported.")+
tr("Due to discontinued support, you should request the merchant to provide you with a BIP21 compatible URI or use a wallet that does continue to support BIP70."), tr("Due to discontinued support, you should request the merchant to provide you with a BIP21 compatible URI or use a wallet that does continue to support BIP70."),
CClientUIInterface::ICON_WARNING); CClientUIInterface::ICON_WARNING);
} else { } else {
Q_EMIT message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address), Q_EMIT message(tr("URI handling"), QString::fromStdString(error_msg),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
} }
} }