only serialize initialized multisig results

This commit is contained in:
woodser
2019-08-21 11:22:20 -04:00
parent 93390bed3a
commit 1dc76b5f82
2 changed files with 3 additions and 14 deletions
-11
View File
@@ -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<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(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
+3 -3
View File
@@ -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;
}