Prevent processing duplicate payment requests
Github-Pull: #17031 Rebased-From: 3f89e1eb237efcbd6415ca2cd0acddb6596153d7 Tree-SHA512: da428b0d70c06a99c948d7d4af0827e517b6d93be11a7462a73cca2b829cc3e40e74eadca5c3148e80be56a7a64213507243a5d7d7e67d5d74317f3c07f2ef16
This commit is contained in:
parent
cd1e7bb064
commit
bd22dea633
1 changed files with 6 additions and 4 deletions
|
@ -82,7 +82,7 @@ static QString ipcServerName()
|
||||||
// the main GUI window is up and ready to ask the user
|
// the main GUI window is up and ready to ask the user
|
||||||
// to send payment.
|
// to send payment.
|
||||||
|
|
||||||
static QList<QString> savedPaymentRequests;
|
static QSet<QString> savedPaymentRequests;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Sending to the server is done synchronously, at startup.
|
// Sending to the server is done synchronously, at startup.
|
||||||
|
@ -107,7 +107,8 @@ void PaymentServer::ipcParseCommandLine(interfaces::Node& node, int argc, char*
|
||||||
// will start a mainnet instance and throw a "wrong network" error.
|
// will start a mainnet instance and throw a "wrong network" error.
|
||||||
if (arg.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI
|
if (arg.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI
|
||||||
{
|
{
|
||||||
savedPaymentRequests.append(arg);
|
if (savedPaymentRequests.contains(arg)) continue;
|
||||||
|
savedPaymentRequests.insert(arg);
|
||||||
|
|
||||||
SendCoinsRecipient r;
|
SendCoinsRecipient r;
|
||||||
if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty())
|
if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty())
|
||||||
|
@ -127,7 +128,8 @@ void PaymentServer::ipcParseCommandLine(interfaces::Node& node, int argc, char*
|
||||||
#ifdef ENABLE_BIP70
|
#ifdef ENABLE_BIP70
|
||||||
else if (QFile::exists(arg)) // Filename
|
else if (QFile::exists(arg)) // Filename
|
||||||
{
|
{
|
||||||
savedPaymentRequests.append(arg);
|
if (savedPaymentRequests.contains(arg)) continue;
|
||||||
|
savedPaymentRequests.insert(arg);
|
||||||
|
|
||||||
PaymentRequestPlus request;
|
PaymentRequestPlus request;
|
||||||
if (readPaymentRequestFromFile(arg, request))
|
if (readPaymentRequestFromFile(arg, request))
|
||||||
|
@ -280,7 +282,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
|
||||||
{
|
{
|
||||||
if (saveURIs)
|
if (saveURIs)
|
||||||
{
|
{
|
||||||
savedPaymentRequests.append(s);
|
savedPaymentRequests.insert(s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue