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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user