diff options
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 10 | ||||
-rw-r--r-- | src/wallet/wallet2.h | 18 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 3190c0496..801df3400 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -2163,12 +2163,16 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri // if more than one tx necessary, prompt user to confirm if (m_wallet->always_confirm_transfers() || ptx_vector.size() > 1) { + uint64_t total_sent = 0; uint64_t total_fee = 0; uint64_t dust_not_in_fee = 0; uint64_t dust_in_fee = 0; for (size_t n = 0; n < ptx_vector.size(); ++n) { total_fee += ptx_vector[n].fee; + for (auto i: ptx_vector[n].selected_transfers) + total_sent += m_wallet->get_transfer_details(i).amount(); + total_sent -= ptx_vector[n].change_dts.amount + ptx_vector[n].fee; if (ptx_vector[n].dust_added_to_fee) dust_in_fee += ptx_vector[n].dust; @@ -2177,6 +2181,7 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri } std::stringstream prompt; + prompt << boost::format(tr("Sending %s. ")) % print_money(total_sent); if (ptx_vector.size() > 1) { prompt << boost::format(tr("Your transaction needs to be split into %llu transactions. " @@ -2879,12 +2884,16 @@ bool simple_wallet::submit_transfer(const std::vector<std::string> &args_) // if more than one tx necessary, prompt user to confirm if (m_wallet->always_confirm_transfers()) { + uint64_t total_sent = 0; uint64_t total_fee = 0; uint64_t dust_not_in_fee = 0; uint64_t dust_in_fee = 0; for (size_t n = 0; n < ptx_vector.size(); ++n) { total_fee += ptx_vector[n].fee; + for (auto i: ptx_vector[n].selected_transfers) + total_sent += m_wallet->get_transfer_details(i).amount(); + total_sent -= ptx_vector[n].change_dts.amount + ptx_vector[n].fee; if (ptx_vector[n].dust_added_to_fee) dust_in_fee += ptx_vector[n].dust; @@ -2893,6 +2902,7 @@ bool simple_wallet::submit_transfer(const std::vector<std::string> &args_) } std::stringstream prompt; + prompt << boost::format(tr("Sending %s. ")) % print_money(total_sent); if (ptx_vector.size() > 1) { prompt << boost::format(tr("Your transaction needs to be split into %llu transactions. " diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index d42385caf..417e754a5 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -611,7 +611,7 @@ namespace tools }; } BOOST_CLASS_VERSION(tools::wallet2, 15) -BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 5) +BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 6) BOOST_CLASS_VERSION(tools::wallet2::payment_details, 1) BOOST_CLASS_VERSION(tools::wallet2::unconfirmed_transfer_details, 6) BOOST_CLASS_VERSION(tools::wallet2::confirmed_transfer_details, 3) @@ -640,7 +640,10 @@ namespace boost { x.m_rct = x.m_tx.vout[x.m_internal_output_index].amount == 0; } - x.m_key_image_known = true; + if (ver < 6) + { + x.m_key_image_known = true; + } } template <class Archive> @@ -689,7 +692,18 @@ namespace boost } a & x.m_rct; if (ver < 5) + { + initialize_transfer_details(a, x, ver); return; + } + if (ver < 6) + { + // v5 did not properly initialize + uint8_t u; + a & u; + x.m_key_image_known = true; + return; + } a & x.m_key_image_known; } |