aboutsummaryrefslogtreecommitdiff
path: root/src/base58.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base58.cpp')
-rw-r--r--src/base58.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/base58.cpp b/src/base58.cpp
index 3802f953f9..69692c95eb 100644
--- a/src/base58.cpp
+++ b/src/base58.cpp
@@ -318,3 +318,25 @@ bool CBitcoinSecret::SetString(const std::string& strSecret)
{
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& params)
+{
+ return CBitcoinAddress(str).IsValid(params);
+}
+
+bool IsValidDestinationString(const std::string& str)
+{
+ return CBitcoinAddress(str).IsValid();
+}