From 8231997b6674b8cd3e01ca242ac71fd829432c8e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 15 Oct 2016 19:18:52 +0100 Subject: simplewallet: fix sweep_all misreporting sweeped amount for rct outputs RingCT outputs will be 0 in the vin, so we need to get the actual amount from elsewhere. --- src/simplewallet/simplewallet.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/simplewallet/simplewallet.cpp') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index b27113473..64cf82800 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -2897,11 +2897,8 @@ bool simple_wallet::sweep_unmixable(const std::vector &args_) for (size_t n = 0; n < ptx_vector.size(); ++n) { total_fee += ptx_vector[n].fee; - for (const auto &vin: ptx_vector[n].tx.vin) - { - if (vin.type() == typeid(txin_to_key)) - total_unmixable += boost::get(vin).amount; - } + for (auto i: ptx_vector[n].selected_transfers) + total_unmixable += m_wallet->get_transfer_details(i).amount(); } std::string prompt_str = tr("Sweeping ") + print_money(total_unmixable); @@ -3152,11 +3149,8 @@ bool simple_wallet::sweep_all(const std::vector &args_) for (size_t n = 0; n < ptx_vector.size(); ++n) { total_fee += ptx_vector[n].fee; - for (const auto &vin: ptx_vector[n].tx.vin) - { - if (vin.type() == typeid(txin_to_key)) - total_sent += boost::get(vin).amount; - } + for (auto i: ptx_vector[n].selected_transfers) + total_sent += m_wallet->get_transfer_details(i).amount(); } std::string prompt_str; -- cgit v1.2.3