aboutsummaryrefslogtreecommitdiff
path: root/src/base58.cpp
diff options
context:
space:
mode:
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;
}