diff options
author | naughtyfox <mail.for.milo@gmail.com> | 2018-09-10 19:18:25 +0300 |
---|---|---|
committer | naughtyfox <mail.for.milo@gmail.com> | 2018-09-10 19:33:08 +0300 |
commit | 26971d46fc06b8be4a6ecc0309f2650f354ddc91 (patch) | |
tree | ee714aae88d86c81a0e878e4a37c962fb2586661 | |
parent | Merge pull request #4290 (diff) | |
download | monero-26971d46fc06b8be4a6ecc0309f2650f354ddc91.tar.xz |
WalletAPI: 'hasMultisigPartialKeyImages' function added
-rw-r--r-- | src/wallet/api/wallet.cpp | 14 | ||||
-rw-r--r-- | src/wallet/api/wallet.h | 1 | ||||
-rw-r--r-- | src/wallet/api/wallet2_api.h | 5 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 7b4ad27e4..43a023d3c 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1244,6 +1244,20 @@ size_t WalletImpl::importMultisigImages(const vector<string>& images) { return 0; } +bool WalletImpl::hasMultisigPartialKeyImages() const { + try { + clearStatus(); + checkMultisigWalletReady(m_wallet); + + return m_wallet->has_multisig_partial_key_images(); + } catch (const exception& e) { + LOG_ERROR("Error on checking for partial multisig key images: ") << e.what(); + setStatusError(string(tr("Failed to check for partial multisig key images: ")) + e.what()); + } + + return false; +} + PendingTransaction* WalletImpl::restoreMultisigTransaction(const string& signData) { try { clearStatus(); diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index 0f3b1ce04..1ae4afb9e 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -139,6 +139,7 @@ public: bool finalizeMultisig(const std::vector<std::string>& extraMultisigInfo) override; bool exportMultisigImages(std::string& images) override; size_t importMultisigImages(const std::vector<std::string>& images) override; + bool hasMultisigPartialKeyImages() const override; PendingTransaction* restoreMultisigTransaction(const std::string& signData) override; PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id, diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h index 5a52c6b17..5c53f712e 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -720,6 +720,11 @@ struct Wallet * @return number of imported images */ virtual size_t importMultisigImages(const std::vector<std::string>& images) = 0; + /** + * @brief hasMultisigPartialKeyImages - checks if wallet needs to import multisig key images from other participants + * @return true if there are partial key images + */ + virtual bool hasMultisigPartialKeyImages() const = 0; /** * @brief restoreMultisigTransaction creates PendingTransaction from signData |