From 1dc76b5f82e484b483db675cee44be88a316eec8 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 21 Aug 2019 11:22:20 -0400 Subject: [PATCH] only serialize initialized multisig results --- src/wallet/monero_wallet.cpp | 11 ----------- src/wallet/monero_wallet_model.cpp | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index 9f73912..318b892 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -811,8 +811,6 @@ namespace monero { } monero_wallet* monero_wallet::open_wallet(const string& path, const string& password, const monero_network_type network_type) { - MTRACE("open_wallet(" << path << ", " << password << ", " << network_type << ")"); - monero_wallet* wallet = new monero_wallet(); MTRACE("open_wallet(" << path << ", " << password << ", " << network_type << ")"); monero_wallet* wallet = new monero_wallet(); wallet->m_w2 = unique_ptr(new tools::wallet2(static_cast(network_type), 1, true)); @@ -2804,16 +2802,7 @@ namespace monero { if (multisig_hexes.size() < 1 || multisig_hexes.size() > total) throw runtime_error("Needs multisig info from more participants"); // finalize multisig - cout << "Finalizing multisig() " << endl; - cout << "Password: " << password << endl; - cout << "Multisig hexes: " << endl; - for (const string& multisig_hex : multisig_hexes) { - cout << "\tHex: " << multisig_hex << endl; - } - - cout << "Start" << endl; bool success = m_w2->finalize_multisig(epee::wipeable_string(password), multisig_hexes); - cout << "Success? " << success << endl; if (!success) throw runtime_error("Error calling finalize_multisig"); // return the multisig wallet's primary address diff --git a/src/wallet/monero_wallet_model.cpp b/src/wallet/monero_wallet_model.cpp index 5c9567d..8487a4a 100644 --- a/src/wallet/monero_wallet_model.cpp +++ b/src/wallet/monero_wallet_model.cpp @@ -735,14 +735,14 @@ namespace monero { boost::property_tree::ptree monero_multisig_init_result::to_property_tree() const { boost::property_tree::ptree node; - node.put("address", *m_address); - node.put("multisigHex", *m_multisig_hex); + if (m_address != boost::none) node.put("address", *m_address); + if (m_multisig_hex != boost::none) node.put("multisigHex", *m_multisig_hex); return node; } boost::property_tree::ptree monero_multisig_sign_result::to_property_tree() const { boost::property_tree::ptree node; - node.put("signedMultisigTxHex", *m_signed_multisig_tx_hex); + if (m_signed_multisig_tx_hex != boost::none) node.put("signedMultisigTxHex", *m_signed_multisig_tx_hex); if (!m_tx_ids.empty()) node.add_child("txIds", monero_utils::to_property_tree(m_tx_ids)); return node; }