Changeset View
Changeset View
Standalone View
Standalone View
src/base58.cpp
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | |||||
bool CBitcoinSecret::SetString(const char *pszSecret) { | bool CBitcoinSecret::SetString(const char *pszSecret) { | ||||
return CBase58Data::SetString(pszSecret) && IsValid(); | return CBase58Data::SetString(pszSecret) && IsValid(); | ||||
} | } | ||||
bool CBitcoinSecret::SetString(const std::string &strSecret) { | bool CBitcoinSecret::SetString(const std::string &strSecret) { | ||||
return SetString(strSecret.c_str()); | return SetString(strSecret.c_str()); | ||||
} | } | ||||
std::string EncodeDestination(const CTxDestination &dest) { | |||||
CBitcoinAddress addr(dest); | |||||
if (!addr.IsValid()) return ""; | |||||
return addr.ToString(); | |||||
} | |||||
CTxDestination DecodeDestination(const std::string &str) { | |||||
return CBitcoinAddress(str).Get(); | |||||
} | |||||
bool IsValidDestinationString(const std::string &str, | |||||
const CChainParams ¶ms) { | |||||
return CBitcoinAddress(str).IsValid(params); | |||||
} | |||||
bool IsValidDestinationString(const std::string &str) { | |||||
return CBitcoinAddress(str).IsValid(); | |||||
} |