aboutsummaryrefslogtreecommitdiff
path: root/src/gen_multisig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen_multisig')
-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;