aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-01-16 19:28:51 +0200
committerRiccardo Spagni <ric@spagni.net>2019-01-16 19:28:51 +0200
commite0c107ee51b060c7db64e4de814f2d362d2408f4 (patch)
tree5d58bec0d9b7e85fbd7a640c4d46bd8134987587 /src/wallet/wallet2.cpp
parentMerge pull request #5005 (diff)
parentwallet2: finalize_multisig now rejects non N-1/N multisig wallets (diff)
downloadmonero-e0c107ee51b060c7db64e4de814f2d362d2408f4.tar.xz
Merge pull request #5004
de9dcdd1 wallet2: finalize_multisig now rejects non N-1/N multisig wallets (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-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 6e38e5c38..b17234023 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -4493,6 +4493,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;
}