mirror of
https://github.com/wownero/wownero.git
synced 2026-11-24 09:34:06 +01:00
replace 'multisig()' with 'get_multisig_status()' using multisig_account_status and including '.kex_is_done' member
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"
|
||||
@@ -84,12 +85,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");
|
||||
}
|
||||
}
|
||||
@@ -102,12 +104,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");
|
||||
}
|
||||
}
|
||||
@@ -1362,7 +1365,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;
|
||||
}
|
||||
@@ -1383,7 +1392,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");
|
||||
}
|
||||
|
||||
@@ -2118,8 +2127,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