Changeset View
Changeset View
Standalone View
Standalone View
src/qt/paymentserver.cpp
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | for (int i = 1; i < argc; i++) { | ||||
// testnet payment request will start a mainnet instance and throw a | // testnet payment request will start a mainnet instance and throw a | ||||
// "wrong network" error. | // "wrong network" error. | ||||
if (arg.startsWith(GUIUtil::URI_SCHEME + ":", | if (arg.startsWith(GUIUtil::URI_SCHEME + ":", | ||||
Qt::CaseInsensitive)) // bitcoincash: URI | Qt::CaseInsensitive)) // bitcoincash: URI | ||||
{ | { | ||||
savedPaymentRequests.append(arg); | savedPaymentRequests.append(arg); | ||||
SendCoinsRecipient r; | SendCoinsRecipient r; | ||||
if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty()) { | if (GUIUtil::parseBitcoinURI(GUIUtil::URI_SCHEME, arg, &r) && | ||||
!r.address.isEmpty()) { | |||||
if (IsValidDestinationString(r.address.toStdString(), | if (IsValidDestinationString(r.address.toStdString(), | ||||
Params(CBaseChainParams::MAIN))) { | Params(CBaseChainParams::MAIN))) { | ||||
SelectParams(CBaseChainParams::MAIN); | SelectParams(CBaseChainParams::MAIN); | ||||
} else if (IsValidDestinationString( | } else if (IsValidDestinationString( | ||||
r.address.toStdString(), | r.address.toStdString(), | ||||
Params(CBaseChainParams::TESTNET))) { | Params(CBaseChainParams::TESTNET))) { | ||||
SelectParams(CBaseChainParams::TESTNET); | SelectParams(CBaseChainParams::TESTNET); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | #endif | ||||
.arg(fetchUrl.toString()), | .arg(fetchUrl.toString()), | ||||
CClientUIInterface::ICON_WARNING); | CClientUIInterface::ICON_WARNING); | ||||
} | } | ||||
return; | return; | ||||
} else { | } else { | ||||
// normal URI | // normal URI | ||||
SendCoinsRecipient recipient; | SendCoinsRecipient recipient; | ||||
if (GUIUtil::parseBitcoinURI(s, &recipient)) { | if (GUIUtil::parseBitcoinURI(GUIUtil::URI_SCHEME, s, &recipient)) { | ||||
if (!IsValidDestinationString( | if (!IsValidDestinationString( | ||||
recipient.address.toStdString())) { | recipient.address.toStdString())) { | ||||
Q_EMIT message( | Q_EMIT message( | ||||
tr("URI handling"), | tr("URI handling"), | ||||
tr("Invalid payment address %1").arg(recipient.address), | tr("Invalid payment address %1").arg(recipient.address), | ||||
CClientUIInterface::MSG_ERROR); | CClientUIInterface::MSG_ERROR); | ||||
} else | } else | ||||
Q_EMIT receivedPaymentRequest(recipient); | Q_EMIT receivedPaymentRequest(recipient); | ||||
▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines |