aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet.cpp
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2017-01-12 22:10:38 +0100
committerJaquee <jaquee.monero@gmail.com>2017-01-13 22:05:39 +0100
commit46550c0b4fc99e374c0df085e27edba1c6a3776c (patch)
tree8a8ddfeb5aad701edd8150a681d7ec092d74d128 /src/wallet/api/wallet.cpp
parentMerge pull request #1562 (diff)
downloadmonero-46550c0b4fc99e374c0df085e27edba1c6a3776c.tar.xz
Wallet API: add rescanSpent()
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r--src/wallet/api/wallet.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index e8ae7c642..5c2a5045c 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1217,6 +1217,24 @@ bool WalletImpl::parse_uri(const std::string &uri, std::string &address, std::st
return m_wallet->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error);
}
+bool WalletImpl::rescanSpent()
+{
+ clearStatus();
+ if (!trustedDaemon()) {
+ m_status = Status_Error;
+ m_errorString = tr("Rescan spent can only be used with a trusted daemon");
+ return false;
+ }
+ try {
+ m_wallet->rescan_spent();
+ } catch (const std::exception &e) {
+ LOG_ERROR(__FUNCTION__ << " error: " << e.what());
+ m_status = Status_Error;
+ m_errorString = e.what();
+ return false;
+ }
+ return true;
+}
} // namespace
namespace Bitmonero = Monero;