monero_wallet->is_watch_only()

This commit is contained in:
woodser
2020-03-13 14:56:17 -04:00
parent e496a2c571
commit 30717f7483
4 changed files with 14 additions and 0 deletions
+10
View File
@@ -129,6 +129,16 @@ namespace monero {
*/
virtual ~monero_wallet() {}
/**
* Indicates if the wallet is watch-only, meaning it does have the private
* spend key and can therefore only observe incoming outputs.
*
* @return true if the wallet is watch-only, false otherwise
*/
virtual bool is_watch_only() const {
throw runtime_error("is_watch_only() not supported");
}
/**
* Set the wallet's daemon connection.
*
+1
View File
@@ -173,6 +173,7 @@ namespace monero {
/**
* Supported wallet methods.
*/
bool is_watch_only() const { return m_w2->watch_only(); }
void set_daemon_connection(const string& uri, const string& username = "", const string& password = "");
void set_daemon_connection(const boost::optional<monero_rpc_connection>& connection);
boost::optional<monero_rpc_connection> get_daemon_connection() const;
+1
View File
@@ -178,6 +178,7 @@ namespace monero {
}
// initialize remaining wallet
wallet->m_is_watch_only = !has_spend_key;
wallet->m_network_type = network_type;
if (!spend_key.empty()) {
wallet->m_language = language;
+2
View File
@@ -116,6 +116,7 @@ namespace monero {
/**
* Supported wallet methods.
*/
bool is_watch_only() const { return m_is_watch_only; }
monero_version get_version() const;
monero_network_type get_network_type() const { return m_network_type; }
string get_mnemonic() const { return m_mnemonic; }
@@ -137,6 +138,7 @@ namespace monero {
// --------------------------------- PRIVATE --------------------------------
private:
bool m_is_watch_only;
monero_network_type m_network_type;
cryptonote::account_base m_account;
string m_mnemonic;