From 798535149d85d2a1db9f6c21584fd43368cd3fe1 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 12 Mar 2018 12:33:05 +0000 Subject: wallet2_api: add key reuse mitigations API --- src/wallet/api/wallet.cpp | 15 +++++++++++++++ src/wallet/api/wallet.h | 3 +++ src/wallet/api/wallet2_api.h | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index be3ca9853..4838395cd 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1990,6 +1990,21 @@ bool WalletImpl::setRing(const std::string &key_image, const std::vectorsegregate_pre_fork_outputs(segregate); +} + +void WalletImpl::segregationHeight(uint64_t height) +{ + m_wallet->segregation_height(height); +} + +void WalletImpl::keyReuseMitigation2(bool mitigation) +{ + m_wallet->key_reuse_mitigation2(mitigation); +} + } // namespace namespace Bitmonero = Monero; diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index 9d40008d1..4bde20959 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -167,6 +167,9 @@ public: virtual bool unblackballOutput(const std::string &pubkey); virtual bool getRing(const std::string &key_image, std::vector &ring) const; virtual bool setRing(const std::string &key_image, const std::vector &ring, bool relative); + virtual void segregatePreForkOutputs(bool segregate); + virtual void segregationHeight(uint64_t height); + virtual void keyReuseMitigation2(bool mitigation); private: void clearStatus() const; diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h index b67e13ac5..c77e495a2 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -769,6 +769,15 @@ struct Wallet //! sets the ring used for a key image virtual bool setRing(const std::string &key_image, const std::vector &ring, bool relative) = 0; + //! sets whether pre-fork outs are to be segregated + virtual void segregatePreForkOutputs(bool segregate) = 0; + + //! sets the height where segregation should occur + virtual void segregationHeight(uint64_t height) = 0; + + //! secondary key reuse mitigation + virtual void keyReuseMitigation2(bool mitigation) = 0; + //! Light wallet authenticate and login virtual bool lightWalletLogin(bool &isNewWallet) const = 0; -- cgit v1.2.3