diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-15 14:44:49 -0500 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-15 14:44:49 -0500 |
commit | 935f50471ccaf70c72fec78394908a789748a0b1 (patch) | |
tree | 42af94ef1f73f6bb36624d97b85aa47c4629fb12 /src/wallet/api | |
parent | Merge pull request #1552 (diff) | |
parent | Wallet API: add rescanSpent() (diff) | |
download | monero-935f50471ccaf70c72fec78394908a789748a0b1.tar.xz |
Merge pull request #1560
46550c0b Wallet API: add rescanSpent() (Jaquee)
Diffstat (limited to 'src/wallet/api')
-rw-r--r-- | src/wallet/api/wallet.cpp | 18 | ||||
-rw-r--r-- | src/wallet/api/wallet.h | 2 |
2 files changed, 19 insertions, 1 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; diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index 5b4064e8e..df66f428d 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -93,7 +93,7 @@ public: void setRefreshFromBlockHeight(uint64_t refresh_from_block_height); void setRecoveringFromSeed(bool recoveringFromSeed); bool watchOnly() const; - + bool rescanSpent(); PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id, |