aboutsummaryrefslogtreecommitdiff
path: root/src/gen_multisig/gen_multisig.cpp
diff options
context:
space:
mode:
authorLeon Klingele <git@leonklingele.de>2018-02-25 17:59:52 +0100
committerLeon Klingele <git@leonklingele.de>2018-03-10 16:28:23 +0100
commit649a1b7ae663888c1ff51ce7b0fa2ed22a719aa4 (patch)
treefbc38bc01570207651808b7bffd112fa37bbad88 /src/gen_multisig/gen_multisig.cpp
parentMerge pull request #3261 (diff)
downloadmonero-649a1b7ae663888c1ff51ce7b0fa2ed22a719aa4.tar.xz
wallet2 / simplewallet: Must opt-in to create '.address.txt' files for new wallets
Previously, a file containing the unencrypted Monero address was created by default in the wallet's directory. This file might pose as a privacy risk. The creation of this file is now opt-in and can be enabled by providing --create-address-file
Diffstat (limited to 'src/gen_multisig/gen_multisig.cpp')
-rw-r--r--src/gen_multisig/gen_multisig.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gen_multisig/gen_multisig.cpp b/src/gen_multisig/gen_multisig.cpp
index 9bcf4495c..e165b8053 100644
--- a/src/gen_multisig/gen_multisig.cpp
+++ b/src/gen_multisig/gen_multisig.cpp
@@ -73,11 +73,12 @@ namespace
const command_line::arg_descriptor<uint32_t> arg_threshold = {"threshold", genms::tr("How many signers are required to sign a valid transaction"), 0};
const command_line::arg_descriptor<bool, false> arg_testnet = {"testnet", genms::tr("Create testnet multisig wallets"), false};
const command_line::arg_descriptor<bool, false> arg_stagenet = {"stagenet", genms::tr("Create stagenet multisig wallets"), false};
+ const command_line::arg_descriptor<bool, false> arg_create_address_file = {"create-address-file", genms::tr("Create an address file for new wallets"), false};
const command_line::arg_descriptor< std::vector<std::string> > arg_command = {"command", ""};
}
-static bool generate_multisig(uint32_t threshold, uint32_t total, const std::string &basename, network_type nettype)
+static bool generate_multisig(uint32_t threshold, uint32_t total, const std::string &basename, network_type nettype, bool create_address_file)
{
tools::msg_writer() << (boost::format(genms::tr("Generating %u %u/%u multisig wallets")) % total % threshold % total).str();
@@ -92,7 +93,7 @@ static bool generate_multisig(uint32_t threshold, uint32_t total, const std::str
std::string name = basename + "-" + std::to_string(n + 1);
wallets[n].reset(new tools::wallet2(nettype));
wallets[n]->init("");
- wallets[n]->generate(name, pwd_container->password(), rct::rct2sk(rct::skGen()), false, false);
+ wallets[n]->generate(name, pwd_container->password(), rct::rct2sk(rct::skGen()), false, false, create_address_file);
}
// gather the keys
@@ -171,6 +172,7 @@ int main(int argc, char* argv[])
command_line::add_arg(desc_params, arg_participants);
command_line::add_arg(desc_params, arg_testnet);
command_line::add_arg(desc_params, arg_stagenet);
+ command_line::add_arg(desc_params, arg_create_address_file);
const auto vm = wallet_args::main(
argc, argv,
@@ -241,7 +243,8 @@ int main(int argc, char* argv[])
tools::fail_msg_writer() << genms::tr("Error: unsupported scheme: only N/N and N-1/N are supported");
return 1;
}
- if (!generate_multisig(threshold, total, basename, testnet ? TESTNET : stagenet ? STAGENET : MAINNET))
+ bool create_address_file = command_line::get_arg(*vm, arg_create_address_file);
+ if (!generate_multisig(threshold, total, basename, testnet ? TESTNET : stagenet ? STAGENET : MAINNET, create_address_file))
return 1;
return 0;