aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-07-31 07:50:41 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-07 21:12:27 +0100
commit61770ec2dab6c959cf5c320eff49f3f4c01a30af (patch)
tree833d3421521dc416b9bf204a1c01ce744fcd084f /src/wallet
parentMerge pull request #2225 (diff)
downloadmonero-61770ec2dab6c959cf5c320eff49f3f4c01a30af.tar.xz
change mixin to ring size in user visible places
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/api/unsigned_transaction.cpp10
-rw-r--r--src/wallet/api/wallet.cpp8
-rw-r--r--src/wallet/wallet2.cpp4
-rw-r--r--src/wallet/wallet_errors.h4
-rw-r--r--src/wallet/wallet_rpc_server.cpp4
5 files changed, 15 insertions, 15 deletions
diff --git a/src/wallet/api/unsigned_transaction.cpp b/src/wallet/api/unsigned_transaction.cpp
index 1d9ef5d7c..961bd772a 100644
--- a/src/wallet/api/unsigned_transaction.cpp
+++ b/src/wallet/api/unsigned_transaction.cpp
@@ -101,7 +101,7 @@ bool UnsignedTransactionImpl::checkLoadedTx(const std::function<size_t()> get_nu
{
// gather info to ask the user
uint64_t amount = 0, amount_to_dests = 0, change = 0;
- size_t min_mixin = ~0;
+ size_t min_ring_size = ~0;
std::unordered_map<std::string, uint64_t> dests;
const std::string wallet_address = m_wallet.m_wallet->get_account().get_public_address_str(m_wallet.m_wallet->testnet());
int first_known_non_zero_change_index = -1;
@@ -111,9 +111,9 @@ bool UnsignedTransactionImpl::checkLoadedTx(const std::function<size_t()> get_nu
for (size_t s = 0; s < cd.sources.size(); ++s)
{
amount += cd.sources[s].amount;
- size_t mixin = cd.sources[s].outputs.size() - 1;
- if (mixin < min_mixin)
- min_mixin = mixin;
+ size_t ring_size = cd.sources[s].outputs.size();
+ if (ring_size < min_ring_size)
+ min_ring_size = ring_size;
}
for (size_t d = 0; d < cd.splitted_dsts.size(); ++d)
{
@@ -178,7 +178,7 @@ bool UnsignedTransactionImpl::checkLoadedTx(const std::function<size_t()> get_nu
else
change_string += tr("no change");
uint64_t fee = amount - amount_to_dests;
- m_confirmationMessage = (boost::format(tr("Loaded %lu transactions, for %s, fee %s, %s, %s, with min mixin %lu. %s")) % (unsigned long)get_num_txes() % cryptonote::print_money(amount) % cryptonote::print_money(fee) % dest_string % change_string % (unsigned long)min_mixin % extra_message).str();
+ m_confirmationMessage = (boost::format(tr("Loaded %lu transactions, for %s, fee %s, %s, %s, with min ring size %lu. %s")) % (unsigned long)get_num_txes() % cryptonote::print_money(amount) % cryptonote::print_money(fee) % dest_string % change_string % (unsigned long)min_ring_size % extra_message).str();
return true;
}
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 9915a9ca1..a2bb44cfe 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1009,9 +1009,9 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
} catch (const tools::error::not_enough_outs_to_mix& e) {
std::ostringstream writer;
- writer << tr("not enough outputs for specified mixin_count") << " = " << e.mixin_count() << ":";
+ writer << tr("not enough outputs for specified ring size") << " = " << (e.mixin_count() + 1) << ":";
for (const std::pair<uint64_t, uint64_t> outs_for_amount : e.scanty_outs()) {
- writer << "\n" << tr("output amount") << " = " << print_money(outs_for_amount.first) << ", " << tr("found outputs to mix") << " = " << outs_for_amount.second;
+ writer << "\n" << tr("output amount") << " = " << print_money(outs_for_amount.first) << ", " << tr("found outputs to use") << " = " << outs_for_amount.second;
}
m_errorString = writer.str();
m_status = Status_Error;
@@ -1103,9 +1103,9 @@ PendingTransaction *WalletImpl::createSweepUnmixableTransaction()
} catch (const tools::error::not_enough_outs_to_mix& e) {
std::ostringstream writer;
- writer << tr("not enough outputs for specified mixin_count") << " = " << e.mixin_count() << ":";
+ writer << tr("not enough outputs for specified ring size") << " = " << (e.mixin_count() + 1) << ":";
for (const std::pair<uint64_t, uint64_t> outs_for_amount : e.scanty_outs()) {
- writer << "\n" << tr("output amount") << " = " << print_money(outs_for_amount.first) << ", " << tr("found outputs to mix") << " = " << outs_for_amount.second;
+ writer << "\n" << tr("output amount") << " = " << print_money(outs_for_amount.first) << ", " << tr("found outputs to use") << " = " << outs_for_amount.second;
}
m_errorString = writer.str();
m_status = Status_Error;
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 034b0a02a..e569197b8 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -3270,7 +3270,7 @@ bool wallet2::sign_tx(unsigned_tx_set &exported_txs, const std::string &signed_f
for (size_t n = 0; n < exported_txs.txes.size(); ++n)
{
const tools::wallet2::tx_construction_data &sd = exported_txs.txes[n];
- LOG_PRINT_L1(" " << (n+1) << ": " << sd.sources.size() << " inputs, mixin " << (sd.sources[0].outputs.size()-1));
+ LOG_PRINT_L1(" " << (n+1) << ": " << sd.sources.size() << " inputs, ring size " << sd.sources[0].outputs.size());
signed_txes.ptx.push_back(pending_tx());
tools::wallet2::pending_tx &ptx = signed_txes.ptx.back();
crypto::secret_key tx_key;
@@ -4137,7 +4137,7 @@ static size_t estimate_rct_tx_size(int n_inputs, int mixin, int n_outputs)
// txnFee
size += 4;
- LOG_PRINT_L2("estimated rct tx size for " << n_inputs << " at mixin " << mixin << " and " << n_outputs << ": " << size << " (" << ((32 * n_inputs/*+1*/) + 2 * 32 * (mixin+1) * n_inputs + 32 * n_outputs) << " saved)");
+ LOG_PRINT_L2("estimated rct tx size for " << n_inputs << " with ring size " << (mixin+1) << " and " << n_outputs << ": " << size << " (" << ((32 * n_inputs/*+1*/) + 2 * 32 * (mixin+1) * n_inputs + 32 * n_outputs) << " saved)");
return size;
}
diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h
index 16807e045..2e5acc8cb 100644
--- a/src/wallet/wallet_errors.h
+++ b/src/wallet/wallet_errors.h
@@ -417,7 +417,7 @@ namespace tools
typedef std::unordered_map<uint64_t, uint64_t> scanty_outs_t;
explicit not_enough_outs_to_mix(std::string&& loc, const scanty_outs_t& scanty_outs, size_t mixin_count)
- : transfer_error(std::move(loc), "not enough outputs to mix")
+ : transfer_error(std::move(loc), "not enough outputs to use")
, m_scanty_outs(scanty_outs)
, m_mixin_count(mixin_count)
{
@@ -429,7 +429,7 @@ namespace tools
std::string to_string() const
{
std::ostringstream ss;
- ss << transfer_error::to_string() << ", mixin_count = " << m_mixin_count << ", scanty_outs:";
+ ss << transfer_error::to_string() << ", ring size = " << (m_mixin_count + 1) << ", scanty_outs:";
for (const auto& out: m_scanty_outs)
{
ss << '\n' << cryptonote::print_money(out.first) << " - " << out.second;
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 58b020740..f014c573a 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -456,7 +456,7 @@ namespace tools
{
uint64_t mixin = req.mixin;
if (mixin < 2 && m_wallet->use_fork_rules(2, 10)) {
- LOG_PRINT_L1("Requested mixin " << req.mixin << " too low for hard fork 2, using 2");
+ LOG_PRINT_L1("Requested ring size " << (req.mixin + 1) << " too low for hard fork 2, using 3");
mixin = 2;
}
std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_2(dsts, mixin, req.unlock_time, req.priority, extra, m_trusted_daemon);
@@ -534,7 +534,7 @@ namespace tools
uint64_t mixin = req.mixin;
uint64_t ptx_amount;
if (mixin < 2 && m_wallet->use_fork_rules(2, 10)) {
- LOG_PRINT_L1("Requested mixin " << req.mixin << " too low for hard fork 2, using 2");
+ LOG_PRINT_L1("Requested ring size " << (req.mixin + 1) << " too low for hard fork 2, using 3");
mixin = 2;
}
std::vector<wallet2::pending_tx> ptx_vector;