CBitcoinSecret::SetString() now calls IsValid() to make sure it was passed something with the correct version.

This commit is contained in:
Chris Moore
2012-04-12 13:13:08 -07:00
parent b7dc02381f
commit b3a6e613fc
2 changed files with 17 additions and 5 deletions

View File

@@ -396,6 +396,16 @@ public:
return fExpectTestNet == fTestNet && (vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1));
}
bool SetString(const char* pszSecret)
{
return CBase58Data::SetString(pszSecret) && IsValid();
}
bool SetString(const std::string& strSecret)
{
return SetString(strSecret.c_str());
}
CBitcoinSecret(const CSecret& vchSecret, bool fCompressed)
{
SetSecret(vchSecret, fCompressed);