aboutsummaryrefslogtreecommitdiff
path: root/src/base58.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <jrn@jrn.me.uk>2014-08-02 19:54:57 +0100
committerRoss Nicoll <jrn@jrn.me.uk>2014-08-30 09:39:59 +0100
commite84843c0dbb9cb853b912c09858b01c5c9302b09 (patch)
treeda59bc29ef10f63bc53ccba2e392c4979f37d353 /src/base58.cpp
parent9d26dc3b2973252cc4dbe0f46edb56bfcea1cb78 (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/base58.cpp')
-rw-r--r--src/base58.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/base58.cpp b/src/base58.cpp
index c9e91beef1..76f0404a18 100644
--- a/src/base58.cpp
+++ b/src/base58.cpp
@@ -215,9 +215,13 @@ bool CBitcoinAddress::Set(const CTxDestination &dest) {
}
bool CBitcoinAddress::IsValid() const {
+ return IsValid(Params());
+}
+
+bool CBitcoinAddress::IsValid(const CChainParams &params) const {
bool fCorrectSize = vchData.size() == 20;
- bool fKnownVersion = vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS) ||
- vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS);
+ bool fKnownVersion = vchVersion == params.Base58Prefix(CChainParams::PUBKEY_ADDRESS) ||
+ vchVersion == params.Base58Prefix(CChainParams::SCRIPT_ADDRESS);
return fCorrectSize && fKnownVersion;
}