From f952db65b709a42e40e6442032edd67ea24b55df Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 18 Aug 2019 10:51:34 -0400 Subject: [PATCH] impl prepare_multisig(), make_multisig() --- src/wallet/monero_wallet.cpp | 11 +++++++++-- src/wallet/monero_wallet.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index 59c5ebe..4d68b99 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -2547,11 +2547,18 @@ namespace monero { } string monero_wallet::prepare_multisig() { - throw runtime_error("prepare_multisig not implemented"); + if (m_w2->multisig()) throw runtime_error("wallet is already multisig"); + if (m_w2->watch_only()) throw runtime_error("wallet is watch-only and cannot be made multisig"); + return m_w2->get_multisig_info(); } monero_multisig_init_result monero_wallet::make_multisig(const vector& multisig_hexes, int threshold, const string& password) { - throw runtime_error("make_multisig not implemented"); + if (m_w2->multisig()) throw runtime_error("wallet is already multisig"); + if (m_w2->watch_only()) throw runtime_error("wallet is watch-only and cannot be made multisig"); + monero_multisig_init_result result; + result.m_address = m_w2->make_multisig(password, multisig_hexes, threshold); + result.m_multisig_hex = m_w2->get_account().get_public_address_str(m_w2->nettype()); + return result; } string monero_wallet::finalize_multisig(const vector& multisig_hexes, const string& password) { diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 7ca0348..93415e7 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -1301,6 +1301,8 @@ namespace monero { */ void close(); + // bool is_multisig() + /** * Get multisig info about this wallet. *