mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge 93feabcb30 into merged_master (Bitcoin PR bitcoin-core/gui#563)
This commit is contained in:
commit
bdfb01f6e1
1 changed files with 1 additions and 22 deletions
|
|
@ -78,32 +78,11 @@ void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
|
|||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
QString arg(argv[i]);
|
||||
if (arg.startsWith("-"))
|
||||
continue;
|
||||
if (arg.startsWith("-")) continue;
|
||||
|
||||
// If the bitcoin: URI contains a payment request, we are not able to detect the
|
||||
// network as that would require fetching and parsing the payment request.
|
||||
// That means clicking such an URI which contains a testnet payment request
|
||||
// will start a mainnet instance and throw a "wrong network" error.
|
||||
if (arg.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI
|
||||
{
|
||||
if (savedPaymentRequests.contains(arg)) continue;
|
||||
savedPaymentRequests.insert(arg);
|
||||
|
||||
SendCoinsRecipient r;
|
||||
if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty())
|
||||
{
|
||||
auto tempChainParams = CreateChainParams(gArgs, CBaseChainParams::MAIN);
|
||||
|
||||
if (IsValidDestinationString(r.address.toStdString(), *tempChainParams)) {
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
} else {
|
||||
tempChainParams = CreateChainParams(gArgs, CBaseChainParams::TESTNET);
|
||||
if (IsValidDestinationString(r.address.toStdString(), *tempChainParams)) {
|
||||
SelectParams(CBaseChainParams::TESTNET);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue