diff options
author | Ross Nicoll <jrn@jrn.me.uk> | 2014-08-02 19:54:57 +0100 |
---|---|---|
committer | Ross Nicoll <jrn@jrn.me.uk> | 2014-08-30 09:39:59 +0100 |
commit | e84843c0dbb9cb853b912c09858b01c5c9302b09 (patch) | |
tree | da59bc29ef10f63bc53ccba2e392c4979f37d353 /src/qt | |
parent | 9d26dc3b2973252cc4dbe0f46edb56bfcea1cb78 (diff) |
Broken addresses on command line no longer trigger testnet.
When passing a bitcoin: URI on the command line, invalid addresses do not incorrectly send the
user to the test network.
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/paymentserver.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index a9f1566d62..3360dd36eb 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -10,6 +10,7 @@ #include "optionsmodel.h" #include "base58.h" +#include "chainparams.h" #include "ui_interface.h" #include "wallet.h" @@ -199,8 +200,11 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { CBitcoinAddress address(r.address.toStdString()); - SelectParams(CBaseChainParams::MAIN); - if (!address.IsValid()) + if (address.IsValid(Params(CBaseChainParams::MAIN))) + { + SelectParams(CBaseChainParams::MAIN); + } + else if (address.IsValid(Params(CBaseChainParams::TESTNET))) { SelectParams(CBaseChainParams::TESTNET); } |