From e86985558e98961c15c07e60873b21169f8d7bb7 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 25 May 2023 13:17:19 -0400 Subject: [PATCH] support getting multisig seed --- src/wallet/monero_wallet_full.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index 5c80e6f..d2b6c57 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -1346,10 +1346,17 @@ namespace monero { } std::string monero_wallet_full::get_mnemonic() const { - if (m_w2->watch_only()) return ""; - epee::wipeable_string wipeable_mnemonic; - m_w2->get_seed(wipeable_mnemonic); - return std::string(wipeable_mnemonic.data(), wipeable_mnemonic.size()); + epee::wipeable_string seed; + bool ready; + if (m_w2->multisig(&ready)) { + if (!ready) throw std::runtime_error("This wallet is multisig, but not yet finalized"); + if (!m_w2->get_multisig_seed(seed)) throw std::runtime_error("Failed to get multisig seed."); + } else { + if (m_w2->watch_only()) return ""; + if (!m_w2->is_deterministic()) return ""; + if (!m_w2->get_seed(seed)) throw std::runtime_error("Failed to get seed."); + } + return std::string(seed.data(), seed.size()); } std::string monero_wallet_full::get_mnemonic_language() const {