diff options
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
| -rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index b264564a8..bca2d975f 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1519,7 +1519,7 @@ namespace tools for (size_t n = 0; n < tx_constructions.size(); ++n) { const tools::wallet2::tx_construction_data &cd = tx_constructions[n]; - res.desc.push_back({0, 0, std::numeric_limits<uint32_t>::max(), 0, {}, "", 0, "", 0, 0, ""}); + res.desc.push_back({0, 0, std::numeric_limits<uint32_t>::max(), 0, {}, {}, "", 0, "", 0, 0, ""}); wallet_rpc::COMMAND_RPC_DESCRIBE_TRANSFER::transfer_description &desc = res.desc.back(); // Clear the recipients collection ready for this loop iteration tx_dests.clear(); @@ -1550,8 +1550,15 @@ namespace tools for (size_t s = 0; s < cd.sources.size(); ++s) { - desc.amount_in += cd.sources[s].amount; - size_t ring_size = cd.sources[s].outputs.size(); + const cryptonote::tx_source_entry &src_in = cd.sources[s]; + desc.sources.emplace_back(); + wallet_rpc::COMMAND_RPC_DESCRIBE_TRANSFER::source &src_out = desc.sources.back(); + src_out.amount = src_in.amount; + src_out.global_index = src_in.outputs.at(src_in.real_output_in_tx_index).first; + src_out.rct = src_in.rct; + src_out.pubkey = epee::string_tools::pod_to_hex(src_in.outputs.at(src_in.real_output_in_tx_index).second); + desc.amount_in += src_in.amount; + size_t ring_size = src_in.outputs.size(); if (ring_size < desc.ring_size) desc.ring_size = ring_size; } @@ -4397,7 +4404,7 @@ namespace tools try { - res.n_outputs = m_wallet->import_multisig(info); + res.n_outputs = m_wallet->import_multisig(info, req.refresh_after_import); } catch (const std::exception &e) { @@ -4406,21 +4413,24 @@ namespace tools return false; } - if (m_wallet->is_trusted_daemon()) + if (req.refresh_after_import) { - try + if (m_wallet->is_trusted_daemon()) { - m_wallet->rescan_spent(); + try + { + m_wallet->rescan_spent(); + } + catch (const std::exception &e) + { + er.message = std::string("Success, but failed to update spent status after import multisig info: ") + e.what(); + } } - catch (const std::exception &e) + else { - er.message = std::string("Success, but failed to update spent status after import multisig info: ") + e.what(); + er.message = "Success, but cannot update spent status after import multisig info as daemon is untrusted"; } } - else - { - er.message = "Success, but cannot update spent status after import multisig info as daemon is untrusted"; - } return true; } |
