aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-12-21 23:39:05 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-12-21 23:41:16 +0000
commitde9dcdd179721c9ca1c4ddcf41315d695c6579d0 (patch)
tree63d42bbd6276694b8e89872afa9d535e7f381ca3 /src
parentMerge pull request #4927 (diff)
downloadmonero-de9dcdd179721c9ca1c4ddcf41315d695c6579d0.tar.xz
wallet2: finalize_multisig now rejects non N-1/N multisig wallets
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 097278961..6d5712079 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -4356,6 +4356,23 @@ std::string wallet2::make_multisig(const epee::wipeable_string &password,
bool wallet2::finalize_multisig(const epee::wipeable_string &password, const std::unordered_set<crypto::public_key> &pkeys, std::vector<crypto::public_key> signers)
{
+ bool ready;
+ uint32_t threshold, total;
+ if (!multisig(&ready, &threshold, &total))
+ {
+ MERROR("This is not a multisig wallet");
+ return false;
+ }
+ if (ready)
+ {
+ MERROR("This multisig wallet is already finalized");
+ return false;
+ }
+ if (threshold + 1 != total)
+ {
+ MERROR("finalize_multisig should only be used for N-1/N wallets, use exchange_multisig_keys instead");
+ return false;
+ }
exchange_multisig_keys(password, pkeys, signers);
return true;
}