aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorkoe <ukoe@protonmail.com>2022-05-14 17:07:47 -0500
committerkoe <ukoe@protonmail.com>2022-09-21 12:51:19 -0500
commit1cd21bfba584fa7d886f13684f34c71931eddf4d (patch)
tree58679d5288a870f6a0b062c1f59b76898926b85e /src/simplewallet
parentMerge pull request #8545 (diff)
downloadmonero-1cd21bfba584fa7d886f13684f34c71931eddf4d.tar.xz
add an option to force-update multisig key exchange under some circumstances
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp28
-rw-r--r--src/simplewallet/simplewallet.h2
2 files changed, 18 insertions, 12 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 860c3f0b0..96dd2dd2f 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -243,7 +243,7 @@ namespace
const char* USAGE_IMPORT_OUTPUTS("import_outputs <filename>");
const char* USAGE_SHOW_TRANSFER("show_transfer <txid>");
const char* USAGE_MAKE_MULTISIG("make_multisig <threshold> <string1> [<string>...]");
- const char* USAGE_EXCHANGE_MULTISIG_KEYS("exchange_multisig_keys <string> [<string>...]");
+ const char* USAGE_EXCHANGE_MULTISIG_KEYS("exchange_multisig_keys [force-update-use-with-caution] <string> [<string>...]");
const char* USAGE_EXPORT_MULTISIG_INFO("export_multisig_info <filename>");
const char* USAGE_IMPORT_MULTISIG_INFO("import_multisig_info <filename> [<filename>...]");
const char* USAGE_SIGN_MULTISIG("sign_multisig <filename>");
@@ -1138,11 +1138,22 @@ bool simple_wallet::make_multisig_main(const std::vector<std::string> &args, boo
bool simple_wallet::exchange_multisig_keys(const std::vector<std::string> &args)
{
CHECK_MULTISIG_ENABLED();
- exchange_multisig_keys_main(args, false);
+ bool force_update_use_with_caution = false;
+
+ auto local_args = args;
+ if (args.size() >= 1 && local_args[0] == "force-update-use-with-caution")
+ {
+ force_update_use_with_caution = true;
+ local_args.erase(local_args.begin());
+ }
+
+ exchange_multisig_keys_main(local_args, force_update_use_with_caution, false);
return true;
}
-bool simple_wallet::exchange_multisig_keys_main(const std::vector<std::string> &args, bool called_by_mms) {
+bool simple_wallet::exchange_multisig_keys_main(const std::vector<std::string> &args,
+ const bool force_update_use_with_caution,
+ const bool called_by_mms) {
CHECK_MULTISIG_ENABLED();
bool ready;
if (m_wallet->key_on_device())
@@ -1168,15 +1179,9 @@ bool simple_wallet::exchange_multisig_keys_main(const std::vector<std::string> &
return false;
}
- if (args.size() < 1)
- {
- PRINT_USAGE(USAGE_EXCHANGE_MULTISIG_KEYS);
- return false;
- }
-
try
{
- std::string multisig_extra_info = m_wallet->exchange_multisig_keys(orig_pwd_container->password(), args);
+ std::string multisig_extra_info = m_wallet->exchange_multisig_keys(orig_pwd_container->password(), args, force_update_use_with_caution);
bool ready;
m_wallet->multisig(&ready);
if (!ready)
@@ -11176,7 +11181,8 @@ void simple_wallet::mms_next(const std::vector<std::string> &args)
mms::message m = ms.get_message_by_id(data.message_ids[i]);
sig_args[i] = m.content;
}
- command_successful = exchange_multisig_keys_main(sig_args, true);
+ // todo: update mms to enable 'key exchange force updating'
+ command_successful = exchange_multisig_keys_main(sig_args, false, true);
break;
}
diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h
index 0f2fe7bc6..7c45d45e8 100644
--- a/src/simplewallet/simplewallet.h
+++ b/src/simplewallet/simplewallet.h
@@ -235,7 +235,7 @@ namespace cryptonote
bool make_multisig(const std::vector<std::string>& args);
bool make_multisig_main(const std::vector<std::string>& args, bool called_by_mms);
bool exchange_multisig_keys(const std::vector<std::string> &args);
- bool exchange_multisig_keys_main(const std::vector<std::string> &args, bool called_by_mms);
+ bool exchange_multisig_keys_main(const std::vector<std::string> &args, const bool force_update_use_with_caution, const bool called_by_mms);
bool export_multisig(const std::vector<std::string>& args);
bool export_multisig_main(const std::vector<std::string>& args, bool called_by_mms);
bool import_multisig(const std::vector<std::string>& args);