From e84843c0dbb9cb853b912c09858b01c5c9302b09 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 2 Aug 2014 19:54:57 +0100 Subject: 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. --- src/base58.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/base58.cpp') 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 ¶ms) 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; } -- cgit v1.2.3