diff options
| author | Ross Nicoll <[email protected]> | 2014-08-02 19:54:57 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2014-08-30 09:39:59 +0100 |
| commit | e84843c0dbb9cb853b912c09858b01c5c9302b09 (patch) | |
| tree | da59bc29ef10f63bc53ccba2e392c4979f37d353 /src/base58.cpp | |
| parent | Merge pull request #4707 (diff) | |
| download | discoin-e84843c0dbb9cb853b912c09858b01c5c9302b09.tar.xz discoin-e84843c0dbb9cb853b912c09858b01c5c9302b09.zip | |
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.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/base58.cpp b/src/base58.cpp index c9e91beef..76f0404a1 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; } |