aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-07-19 14:06:54 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-07-19 14:06:54 -0500
commitbe81a27fa468556f138d2228b6a5bb7feddd26e6 (patch)
tree9162831f6e49c84053970e145e5f3ea686a6238e /src/simplewallet
parentMerge pull request #4064 (diff)
parentAllow fractional outputs to be ignored (diff)
downloadmonero-be81a27fa468556f138d2228b6a5bb7feddd26e6.tar.xz
Merge pull request #4071
d6d78f1 Allow fractional outputs to be ignored (stoffu)
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp15
-rw-r--r--src/simplewallet/simplewallet.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index b05b68e89..7ce51a1f6 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -2091,6 +2091,19 @@ bool simple_wallet::set_segregation_height(const std::vector<std::string> &args/
return true;
}
+bool simple_wallet::set_ignore_fractional_outputs(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
+{
+ const auto pwd_container = get_and_verify_password();
+ if (pwd_container)
+ {
+ parse_bool_and_use(args[1], [&](bool r) {
+ m_wallet->ignore_fractional_outputs(r);
+ m_wallet->rewrite(m_wallet_file, pwd_container->password());
+ });
+ }
+ return true;
+}
+
bool simple_wallet::help(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
{
if(args.empty())
@@ -2478,6 +2491,7 @@ bool simple_wallet::set_variable(const std::vector<std::string> &args)
const std::pair<size_t, size_t> lookahead = m_wallet->get_subaddress_lookahead();
success_msg_writer() << "subaddress-lookahead = " << lookahead.first << ":" << lookahead.second;
success_msg_writer() << "segregation-height = " << m_wallet->segregation_height();
+ success_msg_writer() << "ignore-fractional-outputs = " << m_wallet->ignore_fractional_outputs();
return true;
}
else
@@ -2532,6 +2546,7 @@ bool simple_wallet::set_variable(const std::vector<std::string> &args)
CHECK_SIMPLE_VARIABLE("key-reuse-mitigation2", set_key_reuse_mitigation2, tr("0 or 1"));
CHECK_SIMPLE_VARIABLE("subaddress-lookahead", set_subaddress_lookahead, tr("<major>:<minor>"));
CHECK_SIMPLE_VARIABLE("segregation-height", set_segregation_height, tr("unsigned integer"));
+ CHECK_SIMPLE_VARIABLE("ignore-fractional-outputs", set_ignore_fractional_outputs, tr("0 or 1"));
}
fail_msg_writer() << tr("set: unrecognized argument(s)");
return true;
diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h
index 7a788d432..1f2765055 100644
--- a/src/simplewallet/simplewallet.h
+++ b/src/simplewallet/simplewallet.h
@@ -137,6 +137,7 @@ namespace cryptonote
bool set_key_reuse_mitigation2(const std::vector<std::string> &args = std::vector<std::string>());
bool set_subaddress_lookahead(const std::vector<std::string> &args = std::vector<std::string>());
bool set_segregation_height(const std::vector<std::string> &args = std::vector<std::string>());
+ bool set_ignore_fractional_outputs(const std::vector<std::string> &args = std::vector<std::string>());
bool help(const std::vector<std::string> &args = std::vector<std::string>());
bool start_mining(const std::vector<std::string> &args);
bool stop_mining(const std::vector<std::string> &args);