aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/api')
-rw-r--r--src/wallet/api/CMakeLists.txt2
-rw-r--r--src/wallet/api/address_book.cpp2
-rw-r--r--src/wallet/api/address_book.h2
-rw-r--r--src/wallet/api/pending_transaction.cpp2
-rw-r--r--src/wallet/api/pending_transaction.h2
-rw-r--r--src/wallet/api/subaddress.cpp2
-rw-r--r--src/wallet/api/subaddress.h2
-rw-r--r--src/wallet/api/subaddress_account.cpp2
-rw-r--r--src/wallet/api/subaddress_account.h2
-rw-r--r--src/wallet/api/transaction_history.cpp2
-rw-r--r--src/wallet/api/transaction_history.h2
-rw-r--r--src/wallet/api/transaction_info.cpp2
-rw-r--r--src/wallet/api/transaction_info.h2
-rw-r--r--src/wallet/api/unsigned_transaction.cpp2
-rw-r--r--src/wallet/api/unsigned_transaction.h2
-rw-r--r--src/wallet/api/utils.cpp2
-rw-r--r--src/wallet/api/wallet.cpp90
-rw-r--r--src/wallet/api/wallet.h4
-rw-r--r--src/wallet/api/wallet2_api.h11
-rw-r--r--src/wallet/api/wallet_manager.cpp2
-rw-r--r--src/wallet/api/wallet_manager.h2
21 files changed, 32 insertions, 109 deletions
diff --git a/src/wallet/api/CMakeLists.txt b/src/wallet/api/CMakeLists.txt
index af7948d8a..35ce5144b 100644
--- a/src/wallet/api/CMakeLists.txt
+++ b/src/wallet/api/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2022, The Monero Project
+# Copyright (c) 2014-2023, The Monero Project
#
# All rights reserved.
#
diff --git a/src/wallet/api/address_book.cpp b/src/wallet/api/address_book.cpp
index c73653e37..aeffe921e 100644
--- a/src/wallet/api/address_book.cpp
+++ b/src/wallet/api/address_book.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/address_book.h b/src/wallet/api/address_book.h
index 5b0655000..8de7f95ff 100644
--- a/src/wallet/api/address_book.h
+++ b/src/wallet/api/address_book.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/pending_transaction.cpp b/src/wallet/api/pending_transaction.cpp
index 70a702796..47eb7a243 100644
--- a/src/wallet/api/pending_transaction.cpp
+++ b/src/wallet/api/pending_transaction.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/pending_transaction.h b/src/wallet/api/pending_transaction.h
index 0a9779c07..ea2831b25 100644
--- a/src/wallet/api/pending_transaction.h
+++ b/src/wallet/api/pending_transaction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/subaddress.cpp b/src/wallet/api/subaddress.cpp
index 9e358b4c8..7a1460c8e 100644
--- a/src/wallet/api/subaddress.cpp
+++ b/src/wallet/api/subaddress.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2022, The Monero Project
+// Copyright (c) 2017-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/subaddress.h b/src/wallet/api/subaddress.h
index 53ece126d..bcee10577 100644
--- a/src/wallet/api/subaddress.h
+++ b/src/wallet/api/subaddress.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2022, The Monero Project
+// Copyright (c) 2017-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/subaddress_account.cpp b/src/wallet/api/subaddress_account.cpp
index e8153df3d..ebee80e7e 100644
--- a/src/wallet/api/subaddress_account.cpp
+++ b/src/wallet/api/subaddress_account.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2022, The Monero Project
+// Copyright (c) 2017-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/subaddress_account.h b/src/wallet/api/subaddress_account.h
index 94cab47fb..3934df3ef 100644
--- a/src/wallet/api/subaddress_account.h
+++ b/src/wallet/api/subaddress_account.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2022, The Monero Project
+// Copyright (c) 2017-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/transaction_history.cpp b/src/wallet/api/transaction_history.cpp
index 9f5e41156..ad797cc07 100644
--- a/src/wallet/api/transaction_history.cpp
+++ b/src/wallet/api/transaction_history.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/transaction_history.h b/src/wallet/api/transaction_history.h
index 1d52f4a69..04bc8a705 100644
--- a/src/wallet/api/transaction_history.h
+++ b/src/wallet/api/transaction_history.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/transaction_info.cpp b/src/wallet/api/transaction_info.cpp
index 572b04316..8f5ee39a0 100644
--- a/src/wallet/api/transaction_info.cpp
+++ b/src/wallet/api/transaction_info.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/transaction_info.h b/src/wallet/api/transaction_info.h
index 6337f2aaa..33dc8a7f4 100644
--- a/src/wallet/api/transaction_info.h
+++ b/src/wallet/api/transaction_info.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/unsigned_transaction.cpp b/src/wallet/api/unsigned_transaction.cpp
index 6165a2240..07cf93f59 100644
--- a/src/wallet/api/unsigned_transaction.cpp
+++ b/src/wallet/api/unsigned_transaction.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/unsigned_transaction.h b/src/wallet/api/unsigned_transaction.h
index 30065a7fa..4fd1a0b28 100644
--- a/src/wallet/api/unsigned_transaction.h
+++ b/src/wallet/api/unsigned_transaction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/utils.cpp b/src/wallet/api/utils.cpp
index d8dcedc5f..d02fdcaf6 100644
--- a/src/wallet/api/utils.cpp
+++ b/src/wallet/api/utils.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 085f4f9df..0c3aaf853 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
@@ -209,38 +209,6 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
// TODO;
}
- // Light wallet callbacks
- virtual void on_lw_new_block(uint64_t height)
- {
- if (m_listener) {
- m_listener->newBlock(height);
- }
- }
-
- virtual void on_lw_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
- {
- if (m_listener) {
- std::string tx_hash = epee::string_tools::pod_to_hex(txid);
- m_listener->moneyReceived(tx_hash, amount);
- }
- }
-
- virtual void on_lw_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
- {
- if (m_listener) {
- std::string tx_hash = epee::string_tools::pod_to_hex(txid);
- m_listener->unconfirmedMoneyReceived(tx_hash, amount);
- }
- }
-
- virtual void on_lw_money_spent(uint64_t height, const crypto::hash &txid, uint64_t amount)
- {
- if (m_listener) {
- std::string tx_hash = epee::string_tools::pod_to_hex(txid);
- m_listener->moneySpent(tx_hash, amount);
- }
- }
-
virtual void on_device_button_request(uint64_t code)
{
if (m_listener) {
@@ -950,42 +918,11 @@ string WalletImpl::keysFilename() const
bool WalletImpl::init(const std::string &daemon_address, uint64_t upper_transaction_size_limit, const std::string &daemon_username, const std::string &daemon_password, bool use_ssl, bool lightWallet, const std::string &proxy_address)
{
clearStatus();
- m_wallet->set_light_wallet(lightWallet);
if(daemon_username != "")
m_daemon_login.emplace(daemon_username, daemon_password);
return doInit(daemon_address, proxy_address, upper_transaction_size_limit, use_ssl);
}
-bool WalletImpl::lightWalletLogin(bool &isNewWallet) const
-{
- return m_wallet->light_wallet_login(isNewWallet);
-}
-
-bool WalletImpl::lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status)
-{
- try
- {
- tools::COMMAND_RPC_IMPORT_WALLET_REQUEST::response response;
- if(!m_wallet->light_wallet_import_wallet_request(response)){
- setStatusError(tr("Failed to send import wallet request"));
- return false;
- }
- fee = response.import_fee;
- payment_id = response.payment_id;
- new_request = response.new_request;
- request_fulfilled = response.request_fulfilled;
- payment_address = response.payment_address;
- status = response.status;
- }
- catch (const std::exception &e)
- {
- LOG_ERROR("Error sending import wallet request: " << e.what());
- setStatusError(e.what());
- return false;
- }
- return true;
-}
-
void WalletImpl::setRefreshFromBlockHeight(uint64_t refresh_from_block_height)
{
m_wallet->set_refresh_from_block_height(refresh_from_block_height);
@@ -1018,9 +955,6 @@ uint64_t WalletImpl::unlockedBalance(uint32_t accountIndex) const
uint64_t WalletImpl::blockChainHeight() const
{
- if(m_wallet->light_wallet()) {
- return m_wallet->get_light_wallet_scanned_block_height();
- }
return m_wallet->get_blockchain_current_height();
}
uint64_t WalletImpl::approximateBlockChainHeight() const
@@ -1035,9 +969,6 @@ uint64_t WalletImpl::estimateBlockChainHeight() const
uint64_t WalletImpl::daemonBlockChainHeight() const
{
- if(m_wallet->light_wallet()) {
- return m_wallet->get_light_wallet_scanned_block_height();
- }
if (!m_is_connected)
return 0;
std::string err;
@@ -1054,9 +985,6 @@ uint64_t WalletImpl::daemonBlockChainHeight() const
uint64_t WalletImpl::daemonBlockChainTargetHeight() const
{
- if(m_wallet->light_wallet()) {
- return m_wallet->get_light_wallet_blockchain_height();
- }
if (!m_is_connected)
return 0;
std::string err;
@@ -1302,11 +1230,15 @@ bool WalletImpl::scanTransactions(const std::vector<std::string> &txids)
}
txids_u.insert(txid);
}
- std::vector<crypto::hash> txids_v(txids_u.begin(), txids_u.end());
try
{
- m_wallet->scan_tx(txids_v);
+ m_wallet->scan_tx(txids_u);
+ }
+ catch (const tools::error::wont_reprocess_recent_txs_via_untrusted_daemon &e)
+ {
+ setStatusError(e.what());
+ return false;
}
catch (const std::exception &e)
{
@@ -2177,13 +2109,12 @@ Wallet::ConnectionStatus WalletImpl::connected() const
m_is_connected = m_wallet->check_connection(&version, NULL, DEFAULT_CONNECTION_TIMEOUT_MILLIS, &wallet_is_outdated, &daemon_is_outdated);
if (!m_is_connected)
{
- if (!m_wallet->light_wallet() && (wallet_is_outdated || daemon_is_outdated))
+ if (wallet_is_outdated || daemon_is_outdated)
return Wallet::ConnectionStatus_WrongVersion;
else
return Wallet::ConnectionStatus_Disconnected;
}
- // Version check is not implemented in light wallets nodes/wallets
- if (!m_wallet->light_wallet() && (version >> 16) != CORE_RPC_VERSION_MAJOR)
+ if ((version >> 16) != CORE_RPC_VERSION_MAJOR)
return Wallet::ConnectionStatus_WrongVersion;
return Wallet::ConnectionStatus_Connected;
}
@@ -2277,7 +2208,7 @@ void WalletImpl::doRefresh()
LOG_PRINT_L3(__FUNCTION__ << ": doRefresh, rescan = "<<rescan);
// Syncing daemon and refreshing wallet simultaneously is very resource intensive.
// Disable refresh if wallet is disconnected or daemon isn't synced.
- if (m_wallet->light_wallet() || daemonSynced()) {
+ if (daemonSynced()) {
if(rescan)
m_wallet->rescan_blockchain(false);
m_wallet->refresh(trustedDaemon());
@@ -2368,7 +2299,6 @@ bool WalletImpl::doInit(const string &daemon_address, const std::string &proxy_a
// in case new wallet, this will force fast-refresh (pulling hashes instead of blocks)
// If daemon isn't synced a calculated block height will be used instead
- //TODO: Handle light wallet scenario where block height = 0.
if (isNewWallet() && daemonSynced()) {
LOG_PRINT_L2(__FUNCTION__ << ":New Wallet - fast refresh until " << daemonBlockChainHeight());
m_wallet->set_refresh_from_block_height(daemonBlockChainHeight());
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index 4ac672287..d1bf4f759 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
@@ -208,8 +208,6 @@ public:
virtual bool parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error) override;
virtual std::string make_uri(const std::string &address, const std::string &payment_id, uint64_t amount, const std::string &tx_description, const std::string &recipient_name, std::string &error) const override;
virtual std::string getDefaultDataDir() const override;
- virtual bool lightWalletLogin(bool &isNewWallet) const override;
- virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) override;
virtual bool blackballOutputs(const std::vector<std::string> &outputs, bool add) override;
virtual bool blackballOutput(const std::string &amount, const std::string &offset) override;
virtual bool unblackballOutput(const std::string &amount, const std::string &offset) override;
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
index 0ae84adb9..df86da847 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
@@ -38,6 +38,7 @@
#include <ctime>
#include <iostream>
#include <stdexcept>
+#include <cstdint>
// Public interface for libwallet library
namespace Monero {
@@ -541,7 +542,7 @@ struct Wallet
* \param upper_transaction_size_limit
* \param daemon_username
* \param daemon_password
- * \param lightWallet - start wallet in light mode, connect to a openmonero compatible server.
+ * \param lightWallet - deprecated
* \param proxy_address - set proxy address, empty string to disable
* \return - true on success
*/
@@ -1065,12 +1066,6 @@ struct Wallet
//! secondary key reuse mitigation
virtual void keyReuseMitigation2(bool mitigation) = 0;
- //! Light wallet authenticate and login
- virtual bool lightWalletLogin(bool &isNewWallet) const = 0;
-
- //! Initiates a light wallet import wallet request
- virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) = 0;
-
//! locks/unlocks the keys file; returns true on success
virtual bool lockKeysFile() = 0;
virtual bool unlockKeysFile() = 0;
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
index e81b8f83a..1bb4bc27c 100644
--- a/src/wallet/api/wallet_manager.cpp
+++ b/src/wallet/api/wallet_manager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//
diff --git a/src/wallet/api/wallet_manager.h b/src/wallet/api/wallet_manager.h
index a223e1df9..46ec36297 100644
--- a/src/wallet/api/wallet_manager.h
+++ b/src/wallet/api/wallet_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2022, The Monero Project
+// Copyright (c) 2014-2023, The Monero Project
//
// All rights reserved.
//