mirror of
https://github.com/wownero/wownero.git
synced 2026-11-24 09:34:06 +01:00
Merge pull request #7852
8d94d08 replace 'multisig()' with 'get_multisig_status()' using multisig_account_status and including '.kex_is_done' member (koe)
This commit is contained in:
+19
-10
@@ -38,6 +38,7 @@
|
||||
#include "subaddress_account.h"
|
||||
#include "common_defines.h"
|
||||
#include "common/util.h"
|
||||
#include "multisig/multisig_account.h"
|
||||
|
||||
#include "mnemonics/electrum-words.h"
|
||||
#include "mnemonics/english.h"
|
||||
@@ -87,12 +88,13 @@ namespace {
|
||||
throw runtime_error("Wallet is not initialized yet");
|
||||
}
|
||||
|
||||
bool ready;
|
||||
if (!wallet->multisig(&ready)) {
|
||||
const multisig::multisig_account_status ms_status{wallet->get_multisig_status()};
|
||||
|
||||
if (!ms_status.multisig_is_active) {
|
||||
throw runtime_error("Wallet is not multisig");
|
||||
}
|
||||
|
||||
if (!ready) {
|
||||
if (!ms_status.is_ready) {
|
||||
throw runtime_error("Multisig wallet is not finalized yet");
|
||||
}
|
||||
}
|
||||
@@ -105,12 +107,13 @@ namespace {
|
||||
throw runtime_error("Wallet is not initialized yet");
|
||||
}
|
||||
|
||||
bool ready;
|
||||
if (!wallet->multisig(&ready)) {
|
||||
const multisig::multisig_account_status ms_status{wallet->get_multisig_status()};
|
||||
|
||||
if (!ms_status.multisig_is_active) {
|
||||
throw runtime_error("Wallet is not multisig");
|
||||
}
|
||||
|
||||
if (ready) {
|
||||
if (ms_status.is_ready) {
|
||||
throw runtime_error("Multisig wallet is already finalized");
|
||||
}
|
||||
}
|
||||
@@ -1297,7 +1300,13 @@ void WalletImpl::setSubaddressLabel(uint32_t accountIndex, uint32_t addressIndex
|
||||
|
||||
MultisigState WalletImpl::multisig() const {
|
||||
MultisigState state;
|
||||
state.isMultisig = m_wallet->multisig(&state.isReady, &state.threshold, &state.total);
|
||||
const multisig::multisig_account_status ms_status{m_wallet->get_multisig_status()};
|
||||
|
||||
state.isMultisig = ms_status.multisig_is_active;
|
||||
state.kexIsDone = ms_status.kex_is_done;
|
||||
state.isReady = ms_status.is_ready;
|
||||
state.threshold = ms_status.threshold;
|
||||
state.total = ms_status.total;
|
||||
|
||||
return state;
|
||||
}
|
||||
@@ -1318,7 +1327,7 @@ string WalletImpl::makeMultisig(const vector<string>& info, const uint32_t thres
|
||||
try {
|
||||
clearStatus();
|
||||
|
||||
if (m_wallet->multisig()) {
|
||||
if (m_wallet->get_multisig_status().multisig_is_active) {
|
||||
throw runtime_error("Wallet is already multisig");
|
||||
}
|
||||
|
||||
@@ -2053,8 +2062,8 @@ std::string WalletImpl::signMultisigParticipant(const std::string &message) cons
|
||||
{
|
||||
clearStatus();
|
||||
|
||||
bool ready = false;
|
||||
if (!m_wallet->multisig(&ready) || !ready) {
|
||||
const multisig::multisig_account_status ms_status{m_wallet->get_multisig_status()};
|
||||
if (!ms_status.multisig_is_active || !ms_status.is_ready) {
|
||||
m_status = Status_Error;
|
||||
m_errorString = tr("The wallet must be in multisig ready state");
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user