diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-10 14:29:16 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-10 15:07:58 +0200 |
commit | f23869e14bf7710f05f128544f2778dde28a01b7 (patch) | |
tree | b0e93e2202c1126484189c9f8400b4faba41c5d1 /src/base58.cpp | |
parent | fd1caa0961d9a5ceef0b8b232f278c9c27605d63 (diff) | |
parent | e84843c0dbb9cb853b912c09858b01c5c9302b09 (diff) | |
download | bitcoin-f23869e14bf7710f05f128544f2778dde28a01b7.tar.xz |
Merge pull request #4623
e84843c Broken addresses on command line no longer trigger testnet. (Ross Nicoll)
Diffstat (limited to 'src/base58.cpp')
-rw-r--r-- | src/base58.cpp | 8 |
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 ¶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; } |