aboutsummaryrefslogtreecommitdiff
path: root/src/gen_multisig/gen_multisig.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-10-07 19:57:26 +0200
committerRiccardo Spagni <ric@spagni.net>2018-10-07 19:57:26 +0200
commite19652df51aa821818a9e78bb84f966eb0901476 (patch)
tree0ab83bbe8df5b032f51ab10f674e627e8a6d2541 /src/gen_multisig/gen_multisig.cpp
parentMerge pull request #4510 (diff)
parentMultisig M/N functionality core tests added (diff)
downloadmonero-e19652df51aa821818a9e78bb84f966eb0901476.tar.xz
Merge pull request #4036
9acf42d3 Multisig M/N functionality core tests added (naughtyfox) 9f3963e8 Arbitrary M/N multisig schemes: * support in wallet2 * support in monero-wallet-cli * support in monero-wallet-rpc * support in wallet api * support in monero-gen-trusted-multisig * unit tests for multisig wallets creation (naughtyfox)
Diffstat (limited to 'src/gen_multisig/gen_multisig.cpp')
-rw-r--r--src/gen_multisig/gen_multisig.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/gen_multisig/gen_multisig.cpp b/src/gen_multisig/gen_multisig.cpp
index b69ca52ff..8262e86f7 100644
--- a/src/gen_multisig/gen_multisig.cpp
+++ b/src/gen_multisig/gen_multisig.cpp
@@ -130,8 +130,8 @@ static bool generate_multisig(uint32_t threshold, uint32_t total, const std::str
ss << " " << name << std::endl;
}
- // finalize step if needed
- if (!extra_info[0].empty())
+ //exchange keys unless exchange_multisig_keys returns no extra info
+ while (!extra_info[0].empty())
{
std::unordered_set<crypto::public_key> pkeys;
std::vector<crypto::public_key> signers(total);
@@ -145,11 +145,7 @@ static bool generate_multisig(uint32_t threshold, uint32_t total, const std::str
}
for (size_t n = 0; n < total; ++n)
{
- if (!wallets[n]->finalize_multisig(pwd_container->password(), pkeys, signers))
- {
- tools::fail_msg_writer() << genms::tr("Error finalizing multisig");
- return false;
- }
+ extra_info[n] = wallets[n]->exchange_multisig_keys(pwd_container->password(), pkeys, signers);
}
}
@@ -246,11 +242,6 @@ int main(int argc, char* argv[])
return 1;
}
- if (threshold != total-1 && threshold != total)
- {
- tools::fail_msg_writer() << genms::tr("Error: unsupported scheme: only N/N and N-1/N are supported");
- return 1;
- }
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;