From 1cd21bfba584fa7d886f13684f34c71931eddf4d Mon Sep 17 00:00:00 2001 From: koe Date: Sat, 14 May 2022 17:07:47 -0500 Subject: add an option to force-update multisig key exchange under some circumstances --- src/wallet/api/wallet.cpp | 4 ++-- src/wallet/api/wallet.h | 2 +- src/wallet/api/wallet2_api.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/wallet/api') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 470206bc5..5b9d398a9 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1396,12 +1396,12 @@ string WalletImpl::makeMultisig(const vector& info, const uint32_t thres return string(); } -std::string WalletImpl::exchangeMultisigKeys(const std::vector &info) { +std::string WalletImpl::exchangeMultisigKeys(const std::vector &info, const bool force_update_use_with_caution /*= false*/) { try { clearStatus(); checkMultisigWalletNotReady(m_wallet); - return m_wallet->exchange_multisig_keys(epee::wipeable_string(m_password), info); + return m_wallet->exchange_multisig_keys(epee::wipeable_string(m_password), info, force_update_use_with_caution); } catch (const exception& e) { LOG_ERROR("Error on exchanging multisig keys: " << e.what()); setStatusError(string(tr("Failed to exchange multisig keys: ")) + e.what()); diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index 018b2a0ed..ec2d7e9b3 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -146,7 +146,7 @@ public: MultisigState multisig() const override; std::string getMultisigInfo() const override; std::string makeMultisig(const std::vector& info, uint32_t threshold) override; - std::string exchangeMultisigKeys(const std::vector &info) override; + std::string exchangeMultisigKeys(const std::vector &info, const bool force_update_use_with_caution = false) override; bool exportMultisigImages(std::string& images) override; size_t importMultisigImages(const std::vector& images) override; bool hasMultisigPartialKeyImages() const override; diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h index b67bce60c..0ae84adb9 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -796,9 +796,10 @@ struct Wallet /** * @brief exchange_multisig_keys - provides additional key exchange round for arbitrary multisig schemes (like N-1/N, M/N) * @param info - base58 encoded key derivations returned by makeMultisig or exchangeMultisigKeys function call + * @param force_update_use_with_caution - force multisig account to update even if not all signers contribute round messages * @return new info string if more rounds required or an empty string if wallet creation is done */ - virtual std::string exchangeMultisigKeys(const std::vector &info) = 0; + virtual std::string exchangeMultisigKeys(const std::vector &info, const bool force_update_use_with_caution) = 0; /** * @brief exportMultisigImages - exports transfers' key images * @param images - output paramter for hex encoded array of images -- cgit v1.2.3