mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add setFamilySeedGeneric to take any text.
This commit is contained in:
@@ -562,6 +562,24 @@ bool NewcoinAddress::setFamilySeed(const std::string& strSeed)
|
||||
return SetString(strSeed.c_str(), VER_FAMILY_SEED);
|
||||
}
|
||||
|
||||
void NewcoinAddress::setFamilySeedGeneric(const std::string& strText)
|
||||
{
|
||||
if (setFamilySeed(strText))
|
||||
{
|
||||
std::cerr << "Recognized seed." << std::endl;
|
||||
}
|
||||
else if (1 == setFamilySeed1751(strText))
|
||||
{
|
||||
std::cerr << "Recognized 1751 seed." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Creating seed from pass phrase." << std::endl;
|
||||
|
||||
setFamilySeed(CKey::PassPhraseToKey(strText));
|
||||
}
|
||||
}
|
||||
|
||||
void NewcoinAddress::setFamilySeed(uint128 hash128) {
|
||||
SetData(VER_FAMILY_SEED, hash128.begin(), 16);
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ public:
|
||||
|
||||
bool setFamilySeed(const std::string& strSeed);
|
||||
int setFamilySeed1751(const std::string& strHuman1751);
|
||||
void setFamilySeedGeneric(const std::string& strText);
|
||||
void setFamilySeed(uint128 hash128);
|
||||
void setFamilySeedRandom();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user