aboutsummaryrefslogtreecommitdiff
path: root/src/gen_multisig
diff options
context:
space:
mode:
authorkoe <ukoe@protonmail.com>2022-05-14 17:07:47 -0500
committerkoe <ukoe@protonmail.com>2022-09-21 12:38:35 -0500
commit4b0785f1c9a6c6d960749938d64420403d70d8c2 (patch)
tree673f718ebb0b0790d7a4b118936303ae7b8bb15c /src/gen_multisig
parentMerge pull request #8435 (diff)
downloadmonero-4b0785f1c9a6c6d960749938d64420403d70d8c2.tar.xz
add an option to force-update multisig key exchange under some circumstances
Diffstat (limited to 'src/gen_multisig')
-rw-r--r--src/gen_multisig/gen_multisig.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gen_multisig/gen_multisig.cpp b/src/gen_multisig/gen_multisig.cpp
index f13e74b0f..eedd1511d 100644
--- a/src/gen_multisig/gen_multisig.cpp
+++ b/src/gen_multisig/gen_multisig.cpp
@@ -50,7 +50,6 @@
using namespace std;
using namespace epee;
using namespace cryptonote;
-using boost::lexical_cast;
namespace po = boost::program_options;
#undef MONERO_DEFAULT_LOG_CATEGORY
@@ -84,6 +83,9 @@ static bool generate_multisig(uint32_t threshold, uint32_t total, const std::str
try
{
+ if (total == 0)
+ throw std::runtime_error("Signer group of size 0 is not allowed.");
+
// create M wallets first
std::vector<boost::shared_ptr<tools::wallet2>> wallets(total);
for (size_t n = 0; n < total; ++n)
@@ -118,13 +120,17 @@ static bool generate_multisig(uint32_t threshold, uint32_t total, const std::str
ss << " " << name << std::endl;
}
- //exchange keys unless exchange_multisig_keys returns no extra info
- while (!kex_msgs_intermediate[0].empty())
+ // exchange keys until the wallets are done
+ bool ready{false};
+ wallets[0]->multisig(&ready);
+ while (!ready)
{
for (size_t n = 0; n < total; ++n)
{
kex_msgs_intermediate[n] = wallets[n]->exchange_multisig_keys(pwd_container->password(), kex_msgs_intermediate);
}
+
+ wallets[0]->multisig(&ready);
}
std::string address = wallets[0]->get_account().get_public_address_str(wallets[0]->nettype());