Browse Source

Payment request URI syntax changed, from request=... to r=...

BIP 72 was changed to save six bytes in bitcoin: URIs.
pull/1/head
Gavin Andresen 9 years ago
parent
commit
1e01f7c506
  1. 2
      src/qt/openuridialog.cpp
  2. 4
      src/qt/paymentserver.cpp

2
src/qt/openuridialog.cpp

@ -48,5 +48,5 @@ void OpenURIDialog::on_selectFileButton_clicked() @@ -48,5 +48,5 @@ void OpenURIDialog::on_selectFileButton_clicked()
if(filename.isEmpty())
return;
QUrl fileUri = QUrl::fromLocalFile(filename);
ui->uriEdit->setText("bitcoin:?request=" + QUrl::toPercentEncoding(fileUri.toString()));
ui->uriEdit->setText("bitcoin:?r=" + QUrl::toPercentEncoding(fileUri.toString()));
}

4
src/qt/paymentserver.cpp

@ -366,10 +366,10 @@ void PaymentServer::handleURIOrFile(const QString& s) @@ -366,10 +366,10 @@ void PaymentServer::handleURIOrFile(const QString& s)
#else
QUrlQuery uri((QUrl(s)));
#endif
if (uri.hasQueryItem("request"))
if (uri.hasQueryItem("r"))
{
QByteArray temp;
temp.append(uri.queryItemValue("request"));
temp.append(uri.queryItemValue("r"));
QString decoded = QUrl::fromPercentEncoding(temp);
QUrl fetchUrl(decoded, QUrl::StrictMode);

Loading…
Cancel
Save