aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/api/wallet_manager.cpp8
-rw-r--r--src/wallet/api/wallet_manager.h1
-rw-r--r--src/wallet/wallet2_api.h3
3 files changed, 12 insertions, 0 deletions
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
index 5a6f02b01..4ee5ab8df 100644
--- a/src/wallet/api/wallet_manager.cpp
+++ b/src/wallet/api/wallet_manager.cpp
@@ -352,6 +352,14 @@ double WalletManagerImpl::miningHashRate() const
return mres.speed;
}
+std::string WalletManagerImpl::resolveOpenAlias(const std::string &address, bool &dnssec_valid) const
+{
+ std::vector<std::string> addresses = tools::wallet2::addresses_from_url(address, dnssec_valid);
+ if (addresses.empty())
+ return "";
+ return addresses.front();
+}
+
///////////////////// WalletManagerFactory implementation //////////////////////
WalletManager *WalletManagerFactory::getWalletManager()
diff --git a/src/wallet/api/wallet_manager.h b/src/wallet/api/wallet_manager.h
index fe9662534..214afc3fa 100644
--- a/src/wallet/api/wallet_manager.h
+++ b/src/wallet/api/wallet_manager.h
@@ -52,6 +52,7 @@ public:
uint64_t blockchainTargetHeight() const;
uint64_t networkDifficulty() const;
double miningHashRate() const;
+ std::string resolveOpenAlias(const std::string &address, bool &dnssec_valid) const;
private:
WalletManagerImpl() {}
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index 6651b876d..2e1d95b58 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -561,6 +561,9 @@ struct WalletManager
//! returns current mining hash rate (0 if not mining)
virtual double miningHashRate() const = 0;
+
+ //! resolves an OpenAlias address to a monero address
+ virtual std::string resolveOpenAlias(const std::string &address, bool &dnssec_valid) const = 0;
};