CBitcoinAddress should use nVersionBytes == 2.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
committed by
Jack Grigg
parent
fbad4cac24
commit
00e56272e8
@@ -179,9 +179,9 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBase58Data::SetString(const std::string& str)
|
bool CBase58Data::SetString(const std::string& str, unsigned int nVersionBytes)
|
||||||
{
|
{
|
||||||
return SetString(str.c_str());
|
return SetString(str.c_str(), nVersionBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CBase58Data::ToString() const
|
std::string CBase58Data::ToString() const
|
||||||
@@ -251,6 +251,16 @@ bool CBitcoinAddress::IsValid(const CChainParams& params) const
|
|||||||
return fCorrectSize && fKnownVersion;
|
return fCorrectSize && fKnownVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CBitcoinAddress::SetString(const char* pszAddress)
|
||||||
|
{
|
||||||
|
return CBase58Data::SetString(pszAddress, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CBitcoinAddress::SetString(const std::string& strAddress)
|
||||||
|
{
|
||||||
|
return SetString(strAddress.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
CTxDestination CBitcoinAddress::Get() const
|
CTxDestination CBitcoinAddress::Get() const
|
||||||
{
|
{
|
||||||
if (!IsValid())
|
if (!IsValid())
|
||||||
@@ -305,7 +315,7 @@ bool CBitcoinSecret::IsValid() const
|
|||||||
|
|
||||||
bool CBitcoinSecret::SetString(const char* pszSecret)
|
bool CBitcoinSecret::SetString(const char* pszSecret)
|
||||||
{
|
{
|
||||||
return CBase58Data::SetString(pszSecret) && IsValid();
|
return CBase58Data::SetString(pszSecret, 1) && IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBitcoinSecret::SetString(const std::string& strSecret)
|
bool CBitcoinSecret::SetString(const std::string& strSecret)
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ protected:
|
|||||||
void SetData(const std::vector<unsigned char> &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend);
|
void SetData(const std::vector<unsigned char> &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool SetString(const char* psz, unsigned int nVersionBytes = 1);
|
bool SetString(const char* psz, unsigned int nVersionBytes);
|
||||||
bool SetString(const std::string& str);
|
bool SetString(const std::string& str, unsigned int nVersionBytes);
|
||||||
std::string ToString() const;
|
std::string ToString() const;
|
||||||
int CompareTo(const CBase58Data& b58) const;
|
int CompareTo(const CBase58Data& b58) const;
|
||||||
|
|
||||||
@@ -131,6 +131,8 @@ public:
|
|||||||
bool Set(const CTxDestination &dest);
|
bool Set(const CTxDestination &dest);
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
bool IsValid(const CChainParams ¶ms) const;
|
bool IsValid(const CChainParams ¶ms) const;
|
||||||
|
bool SetString(const char* pszSecret);
|
||||||
|
bool SetString(const std::string& strSecret);
|
||||||
|
|
||||||
CBitcoinAddress() {}
|
CBitcoinAddress() {}
|
||||||
CBitcoinAddress(const CTxDestination &dest) { Set(dest); }
|
CBitcoinAddress(const CTxDestination &dest) { Set(dest); }
|
||||||
|
|||||||
Reference in New Issue
Block a user