Changeset View
Changeset View
Standalone View
Standalone View
src/qt/paymentserver.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | static QString ipcServerName() { | ||||
return name; | return name; | ||||
} | } | ||||
// | // | ||||
// We store payment URIs and requests received before the main GUI window is up | // We store payment URIs and requests received before the main GUI window is up | ||||
// and ready to ask the user to send payment. | // and ready to ask the user to send payment. | ||||
// | // | ||||
static QList<QString> savedPaymentRequests; | static QSet<QString> savedPaymentRequests; | ||||
static std::string ipcParseURI(const QString &arg, const CChainParams ¶ms, | static std::string ipcParseURI(const QString &arg, const CChainParams ¶ms, | ||||
bool useCashAddr) { | bool useCashAddr) { | ||||
const QString scheme = QString::fromStdString(params.CashAddrPrefix()); | const QString scheme = QString::fromStdString(params.CashAddrPrefix()); | ||||
if (!arg.startsWith(scheme + ":", Qt::CaseInsensitive)) { | if (!arg.startsWith(scheme + ":", Qt::CaseInsensitive)) { | ||||
return {}; | return {}; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | #ifdef ENABLE_BIP70 | ||||
qWarning() << "PaymentServer::ipcSendCommandLine: Payment request " | qWarning() << "PaymentServer::ipcSendCommandLine: Payment request " | ||||
"from network " | "from network " | ||||
<< QString(itemNetwork->c_str()) | << QString(itemNetwork->c_str()) | ||||
<< " does not match already chosen network " | << " does not match already chosen network " | ||||
<< QString(chosenNetwork->c_str()); | << QString(chosenNetwork->c_str()); | ||||
continue; | continue; | ||||
} | } | ||||
savedPaymentRequests.append(arg); | if (savedPaymentRequests.contains(arg)) { | ||||
continue; | |||||
} | |||||
savedPaymentRequests.insert(arg); | |||||
#endif | #endif | ||||
chosenNetwork = itemNetwork; | chosenNetwork = itemNetwork; | ||||
} | } | ||||
if (chosenNetwork) { | if (chosenNetwork) { | ||||
SelectParams(*chosenNetwork); | SelectParams(*chosenNetwork); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | #endif | ||||
CClientUIInterface::ICON_WARNING); | CClientUIInterface::ICON_WARNING); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
void PaymentServer::handleURIOrFile(const QString &s) { | void PaymentServer::handleURIOrFile(const QString &s) { | ||||
if (saveURIs) { | if (saveURIs) { | ||||
savedPaymentRequests.append(s); | savedPaymentRequests.insert(s); | ||||
return; | return; | ||||
} | } | ||||
// bitcoincash: CashAddr URI | // bitcoincash: CashAddr URI | ||||
if (handleURI(Params(), s)) { | if (handleURI(Params(), s)) { | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 543 Lines • Show Last 20 Lines |