fixed multisig issues from monero_c integration
This commit is contained in:
@@ -82,7 +82,8 @@ using namespace cryptonote;
|
||||
setStatusError(tr("View only wallet cannot use background sync")); \
|
||||
return false; \
|
||||
} \
|
||||
if (m_wallet->multisig()) \
|
||||
const multisig::multisig_account_status ms_status{m_wallet->get_multisig_status()}; \
|
||||
if (ms_status.multisig_is_active) \
|
||||
{ \
|
||||
setStatusError(tr("Multisig wallet cannot use background sync")); \
|
||||
return false; \
|
||||
@@ -119,12 +120,12 @@ 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.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");
|
||||
}
|
||||
}
|
||||
@@ -137,12 +138,12 @@ 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.is_active) {
|
||||
throw runtime_error("Wallet is not multisig");
|
||||
}
|
||||
|
||||
if (ready) {
|
||||
if (ms_status.is_ready) {
|
||||
throw runtime_error("Multisig wallet is already finalized");
|
||||
}
|
||||
}
|
||||
@@ -1441,7 +1442,11 @@ MultisigState WalletImpl::multisig() const {
|
||||
MultisigState state;
|
||||
if (checkBackgroundSync("cannot use multisig"))
|
||||
return 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.isReady = ms_status.is_ready;
|
||||
state.threshold = ms_status.threshold;
|
||||
state.total = ms_status.total;
|
||||
|
||||
return state;
|
||||
}
|
||||
@@ -1466,7 +1471,8 @@ string WalletImpl::makeMultisig(const vector<string>& info, const uint32_t thres
|
||||
try {
|
||||
clearStatus();
|
||||
|
||||
if (m_wallet->multisig()) {
|
||||
const multisig::multisig_account_status ms_status{m_wallet->get_multisig_status()};
|
||||
if (ms_status.multisig_is_active) {
|
||||
throw runtime_error("Wallet is already multisig");
|
||||
}
|
||||
|
||||
@@ -2307,8 +2313,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