Merge pull request #4036
9acf42d3Multisig M/N functionality core tests added (naughtyfox)9f3963e8Arbitrary 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)
This commit is contained in:
@@ -1188,6 +1188,20 @@ string WalletImpl::makeMultisig(const vector<string>& info, uint32_t threshold)
|
||||
return string();
|
||||
}
|
||||
|
||||
std::string WalletImpl::exchangeMultisigKeys(const std::vector<std::string> &info) {
|
||||
try {
|
||||
clearStatus();
|
||||
checkMultisigWalletNotReady(m_wallet);
|
||||
|
||||
return m_wallet->exchange_multisig_keys(epee::wipeable_string(m_password), info);
|
||||
} catch (const exception& e) {
|
||||
LOG_ERROR("Error on exchanging multisig keys: ") << e.what();
|
||||
setStatusError(string(tr("Failed to make multisig: ")) + e.what());
|
||||
}
|
||||
|
||||
return string();
|
||||
}
|
||||
|
||||
bool WalletImpl::finalizeMultisig(const vector<string>& extraMultisigInfo) {
|
||||
try {
|
||||
clearStatus();
|
||||
|
||||
@@ -137,6 +137,7 @@ public:
|
||||
MultisigState multisig() const override;
|
||||
std::string getMultisigInfo() const override;
|
||||
std::string makeMultisig(const std::vector<std::string>& info, uint32_t threshold) override;
|
||||
std::string exchangeMultisigKeys(const std::vector<std::string> &info) override;
|
||||
bool finalizeMultisig(const std::vector<std::string>& extraMultisigInfo) override;
|
||||
bool exportMultisigImages(std::string& images) override;
|
||||
size_t importMultisigImages(const std::vector<std::string>& images) override;
|
||||
|
||||
@@ -706,6 +706,12 @@ struct Wallet
|
||||
* @return in case of N / N wallets returns empty string since no more key exchanges needed. For N - 1 / N wallets returns base58 encoded extra multisig info
|
||||
*/
|
||||
virtual std::string makeMultisig(const std::vector<std::string>& info, uint32_t threshold) = 0;
|
||||
/**
|
||||
* @brief exchange_multisig_keys - provides additional key exchange round for arbitrary multisig schemes (like N-1/N, M/N)
|
||||
* @param info - base58 encoded key derivations returned by makeMultisig or exchangeMultisigKeys function call
|
||||
* @return new info string if more rounds required or an empty string if wallet creation is done
|
||||
*/
|
||||
virtual std::string exchangeMultisigKeys(const std::vector<std::string> &info) = 0;
|
||||
/**
|
||||
* @brief finalizeMultisig - finalizes N - 1 / N multisig wallets creation
|
||||
* @param extraMultisigInfo - wallet participants' extra multisig info obtained with makeMultisig call
|
||||
|
||||
Reference in New Issue
Block a user